Systems and methods for well positioning using a transverse rotating magnetic source

ABSTRACT

Systems and methods for well-drilling operations involving magnetic ranging with a rotating magnetic dipole are provided. In one embodiment, a system for determining a relative location of a magnetic dipole includes a three-axis magnetometer configured to obtain measurements of a time-dependent magnetic field caused by the magnetic source rotating about an axis and data processing circuitry configured to determine a transverse angle of rotation of the measurements such that one of two transverse components is in phase with one axial component when the transverse angle of rotation is used to transform the measurements. The data processing circuitry may determine a spatial relationship between the magnetic source and the three-axis magnetometer based at least in part on the transverse angle of rotation.

BACKGROUND

The present disclosure relates generally to well drilling operationsand, more particularly, to well drilling operations involving magneticranging using a rotating magnetic source.

To access certain hydrocarbons in the earth, two or more wells orboreholes may be drilled with a certain spatial relationship withrespect to one another; specifically, one borehole may be drilled suchthat it has a specific location relative to a previously drilledborehole. For example, heavy oil may be too viscous in its natural stateto be produced from a conventional well, and, thus, an arrangement ofcooperative wells and well features may be utilized to produce such oil.Indeed, to produce heavy oil, a variety of techniques may be employed,including, for example, Steam Assisted Gravity Drainage (SAGD), CrossWell Steam Assisted Gravity Drainage (X-SAGD), or Toe to Heel AirInjection (THAI). All such techniques may benefit by determining aborehole assembly (BHA) location relative to an existing well.

SAGD may generally involve two parallel wells separated by anapproximately constant vertical separation distance (e.g., 4 to 6 m) andan approximately constant transverse horizontal separation distance(e.g., within 1 m) over a horizontal distance of roughly 500 m to 1500m. The upper well in a SAGD well pair may be known as an “injectorwell.” The injector well may inject superheated steam into a heavy oilzone formation, creating a steam chamber to heat the heavy oil containedtherewithin. The lower well in a SAGD well pair may be known as a“producer well.” When the heated heavy oil becomes less viscous, gravitymay pull the oil into the producer well below, from which the oil may beextracted.

Conventional measurement while drilling (MWD) survey data may notprovide sufficient accuracy to maintain a consistent separation distancebetween the injector well and the producer well. Indeed, the directionof a horizontal well may be measured and controlled to approximately+/−3°, and the inclination may be measured and controlled toapproximately +/−1°, using conventional MWD sensors and good directionalsteering practices. However, such relatively small angles may producelarge errors in the position of a long horizontal well. For example, ahorizontal well with a 1000 meter length having a 3° drift may have a 52meter lateral error at the toe of the well. If the same horizontal wellhas a 1° drift in inclination, the well may also have a 17 metervertical error.

To drill one well, such as an injector well, with a certain spatialrelationship with respect to an existing well, such as a producer well,conventional magnetic ranging techniques may be employed. However,determining a position of a BHA in the injector well relative to amagnetometer in the producer well may involve many time-consumingmeasurements using conventional magnetic ranging. For example,measurements may be taken at several distinct locations within one orthe other well, and the magnetometer may be moved forward or backward aspecified distance before taking each measurement. Additionally, suchconventional techniques may necessitate that the two wells beessentially parallel, and may not provide a relative location until theBHA has drilled a distance at least equal to the inter-well separationdistance.

SUMMARY

Certain aspects commensurate in scope with the originally claimedembodiments are set forth below. It should be understood that theseaspects are presented merely to provide the reader with a brief summaryof certain forms the disclosed embodiments might take and that theseaspects are not intended to limit the scope of the invention. Indeed,the invention may encompass a variety of aspects that may not be setforth below.

The present disclosure relates to systems and methods for drilling awell involving magnetic ranging using a rotating magnetic source. In oneembodiment, a system for determining a relative location of a magneticdipole includes a three-axis magnetometer configured to obtainmeasurements of a time-dependent magnetic field caused by the magneticsource rotating about an axis and data processing circuitry configuredto determine a transverse angle of rotation of the measurements suchthat one of two transverse components is in phase with one axialcomponent when the transverse angle of rotation is used to transform themeasurements. The data processing circuitry may determine a spatialrelationship between the magnetic source and the three-axis magnetometerbased at least in part on the transverse angle of rotation.

BRIEF DESCRIPTION OF THE DRAWINGS

Advantages of the invention may become apparent upon reading thefollowing detailed description and upon reference to the drawings inwhich:

FIG. 1 is a schematic of a well-drilling operation involving magneticranging in accordance with an embodiment;

FIG. 2 is a schematic illustrating geometry associated with a rotatingmagnetic dipole in accordance with an embodiment;

FIG. 3 is a schematic further illustrating the geometry described byFIG. 2;

FIG. 4 is a schematic illustrating a spatial relationship between twovectors to an observation point in accordance with an embodiment;

FIG. 5 is a schematic illustrating geometry associated with a transversevector to the observation point of FIG. 4;

FIGS. 6A-C illustrate components of a magnetic field resulting from amagnetic dipole rotating about the z axis in the x-y plane, at theinstant it is pointing in the +x direction, in accordance with anembodiment;

FIGS. 7A-C illustrate components of a magnetic field resulting from amagnetic dipole rotating about the z-axis in the x-y plane, at theinstant it is pointing in the +y direction, in accordance with anembodiment;

FIG. 8 is a schematic illustrating geometry associated with a transversevector to an observation point where a magnetic field associated with arotating magnetic dipole is measured, in accordance with an embodiment;

FIG. 9 is a schematic illustrating geometry associated with a rotatedframe of reference for magnetic field measurements taken from anobservation point, in accordance with an embodiment;

FIG. 10 is a flowchart describing a method of determining a relativelocation between a rotating magnetic dipole and a magnetometer, inaccordance with an embodiment;

FIG. 11 is a plot simulating three-axis measurements of a magneticdipole rotating at a constant frequency, in accordance with anembodiment;

FIG. 12 is a plot in which the simulated measurements of FIG. 11 havebeen transformed into an a rotated frame of reference, in accordancewith an embodiment;

FIG. 13 is a flowchart describing a method of determining a relativelocation between a rotating magnetic dipole and a magnetometer bytransforming magnetic field measurements into a rotated reference frame,in accordance with an embodiment;

FIG. 14 is a plot simulating noisy three-axis measurements of a magneticdipole rotating at a constant frequency, in accordance with anembodiment;

FIG. 15 is a plot of sinusoids fitting least squares fit sinusoids tothe noisy three-axis measurements of FIG. 14, in accordance with anembodiment;

FIG. 16 is a plot in which the least squares sinusoids of FIG. 15 havebeen transformed into a rotated frame of reference, in accordance withan embodiment;

FIG. 17 is another plot simulating noisy three-axis measurements of amagnetic dipole rotating at a constant frequency, in accordance with anembodiment;

FIG. 18 is a plot of sinusoids least squares fit to the noisy three-axismeasurements of FIG. 17, in accordance with an embodiment;

FIG. 19 is a flowchart describing a method of determining a relativelocation between a magnetometer and a magnetic dipole rotating at aconstant frequency by transforming magnetic field measurements into arotated reference frame, in accordance with an embodiment;

FIGS. 20A-C are plots illustrating distance errors using the techniqueof FIG. 19 in the x, y, and z directions, respectively;

FIG. 21 is a flowchart describing a method of determining a relativelocation between a magnetometer and a magnetic dipole rotating at anincreasing or decreasing frequency by transforming magnetic fieldmeasurements into a rotated reference frame, in accordance with anembodiment;

FIG. 22 is a plot of sinusoids least squares fit to noisy three-axismeasurements of a magnetic field caused by a magnetic dipole rotating atan increasing frequency, in accordance with an embodiment;

FIGS. 23A-C are plots illustrating distance errors using the techniqueof FIG. 21 in the x, y, and z directions, respectively;

FIG. 24 is a plot describing variations in frequency and frequency rangeassociated with simulated measurements taken at various points along inthe z-direction using the technique of FIG. 21, in accordance with anembodiment;

FIG. 25 is a plot simulating noisy three-axis measurements of a magneticdipole rotating at an arbitrary frequency, in accordance with anembodiment;

FIG. 26 is a plot in which the simulated measurements of FIG. 25 arerotated and scaled such that the phase of a transverse magnetic fieldcomponent has the same phase as the is aligned with an axial magneticfield component, in accordance with an embodiment;

FIG. 27 is a plot in which the simulated measurements of FIG. 25 aretransformed based on the rotation of FIG. 26, in accordance with anembodiment;

FIG. 28 is a plot in which extrema of the transformed measurements ofFIG. 27 are fitted to determine a maximum amplitude of each component ofthe measurements, in accordance with an embodiment; and

FIG. 29 is a flowchart describing a method of determining a relativelocation between a magnetometer and a magnetic dipole rotating at anarbitrary frequency by transforming magnetic field measurements into arotated reference frame, in accordance with an embodiment.

DETAILED DESCRIPTION OF SPECIFIC EMBODIMENTS

One or more specific embodiments of the present invention are describedbelow. In an effort to provide a concise description of theseembodiments, not all features of an actual implementation are describedin the specification. It should be appreciated that in the developmentof any such actual implementation, as in any engineering or designproject, numerous implementation-specific decisions must be made toachieve the developers' specific goals, such as compliance withsystem-related and business-related constraints, which may vary from oneimplementation to another. Moreover, it should be appreciated that sucha development effort might be complex and time consuming, but wouldnevertheless be a routine undertaking of design, fabrication, andmanufacture for those of ordinary skill having the benefit of thisdisclosure.

Additionally, as used herein, the terms “up” and “down,” “upper” and“lower,” and other like terms indicating relative positions to a givenpoint or element are utilized to more clearly describe some elements ofthe embodiments of the invention. Commonly, these terms relate to areference point at the surface from which drilling operations areinitiated as being the top point and the total depth of the well beingthe lowest point, whether or not the drilled well continues in a truedownward direction.

FIG. 1 illustrates a well drilling system 10 for drilling a new wellsuch that the new well has a particular spatial relationship with aprior-drilled well. Particularly, FIG. 1 presents an example involvingparallel Steam Assisted Gravity Drainage (SAGD) wells; however, the welldrilling system 10 may be used to drill any new well such that the newwell has a particular spatial relationship with respect to an existing,prior-drilled well. As illustrated in FIG. 1, a SAGD well pair may beformed when an injector well 12 is drilled approximately constantvertical separation distance (e.g., 4 to 6 m) and an approximatelyconstant transverse horizontal separation distance (e.g., within 1 m)over a horizontal distance of roughly 500 m to 1500 m above aprior-drilled producer well 14 in a heavy oil zone formation 16.However, the well drilling operation 10 and the techniques disclosedherein may be employed to drill a new well having any desired spatialrelationship to any existing well. For example, the well drillingoperation 10 and the techniques disclosed herein may be employed todrill Cross Well Steam Assisted Gravity Drainage (X-SAGD) wells, Toe toHeel Air Injection (THAI) wells, and/or to avoid collisions withexisting wells while drilling in a field having existing wells.

To drill the injector well 12, a borehole assembly (BHA) 18 may include,among other things, a drill bit 20, a steerable system 22 to set thedirection of the drill bit 20, and/or one or more measurement whiledrilling (MWD) or logging while drilling (LWD) tools 24. Drill pipe 26may provide drilling mud and/or communication to the BHA 18 from thesurface. The steerable system 22 may be a rotary steerable system, suchas PowerDrive, which may receive downlinked commands and drill ahead ina specified trajectory of direction and inclination. Alternatively, thesteerable system 22 may be a mud motor with a bent sub; however, such anarrangement may be less efficient, as it may rely on manual orientationsof the bent sub by a driller at the surface to control the direction andinclination of the drill bit 20.

The BHA 18 may further include a magnetic dipole 28 coupled such thatthe north-south axis of the magnetic dipole 28 is essentiallyperpendicular to the axis of the BHA 18. As the BHA 18 rotates, themagnetic dipole 28 may rotate accordingly, which may produce atime-dependent magnetic field, illustrated in FIG. 1 as a magnetic field{right arrow over (B)}. The magnetic dipole 28 may produce thetime-dependent magnetic field {right arrow over (B)} using a permanentmagnet or one or more solenoids. If the magnetic dipole 28 is formed byone or more solenoids, the electric currents driving the solenoids maybe direct current (DC), and the BHA 18 may rotate to produce thetime-dependent magnetic field {right arrow over (B)}. Alternatively, thecurrents driving the solenoids may be alternating current (AC), and theBHA 18 may remain still to produce the time-dependent magnetic field{right arrow over (B)}. The direction and inclination of the first wellmay be known, as determined using inclinometer and/or data from the MWDtool 24. Because the north-south axis of the magnetic dipole 28 isessentially perpendicular to the axis of the BHA 18, a coordinate system(x,y,z) may be centered on the magnetic dipole 28, where the z-axis isaligned with the borehole axis, the x-axis points upwards, and they-axis is horizontal.

A three-axis magnetometer 30 capable of measuring low-frequency ACmagnetic fields may be deployed to measure the magnetic field {rightarrow over (B)} on a wireline tractor 32 inside the producer well 14,which may or may not be cased with magnetic or non-magnetic casing 34.The tractor 32 may also carry a three-axis inclinometer 36, which mayenable determination of the gravity tool face (i.e., up, or the highside of the hole). The tractor 32 may move the magnetometer 30 alonginside the producer well 14. However, rather than move the magnetometer30 to take measurements at multiple points along the length of theproducer well 14, the tractor 32 may move the magnetometer 30 onlyoccasionally. For reasons discussed below, measurements of the magneticfield {right arrow over (B)} over time, observed from a single locationin the producer well 14, may provide sufficient information to determinea relative location between the magnetometer 30 in the producer well 14and the magnetic dipole 28 in the BHA 18. As such, the three-axismagnetometer 30 may take readings of the magnetic field {right arrowover (B)} over a predetermined time (e.g., approximately 1-2 seconds orone or more periods of rotation of the magnetic dipole 28), from whichthe relative location may be determined in accordance with techniquesdisclosed herein. The BHA 18 may typically rotate at approximately 60 to180 RPM, while the rate of penetration through the formation 16 may besignificantly slower, at approximately 50 to 200 feet per hour. As such,obtaining measurements of the magnetic field {right arrow over (B)} froma single configuration may substantially increase the efficiency ofmagnetic ranging.

Measurements of the magnetic field {right arrow over (B)} may betransmitted from the magnetometer 30 over a cable 38 to the surface 40for processing. As such, the measurements may be received by dataacquisition circuitry 42. The data acquisition circuitry 42 mayrepresent a stand-alone, special-purpose data acquisition moduleassociated with the magnetometer 30, or may represent an input devicefor a general processor-based system that may be employed for processingthe measurements in accordance with the present techniques. A database44 and data processing circuitry 46 may also represent components of ageneral processor-based system. Such a processor-based system may be ageneral-purpose computer, such as a personal computer, configured to runa variety of software, including software implementing all or part ofthe present technique. Alternatively, the processor-based system mayinclude, among other things, a mainframe computer, a distributedcomputing system, or an application-specific computer or workstationconfigured to implement all or part of the present technique based onspecialized software and/or hardware provided as part of the system.Further, the processor-based system may include either a singleprocessor or a plurality of processors to facilitate implementation ofthe presently disclosed functionality.

In general, the processor-based system that may encompass all or part ofthe data acquisition circuitry 42, database 44, and/or data processingcircuitry 46 may include a microcontroller or microprocessor, such as acentral processing unit (CPU), which may execute various routines andprocessing functions. For example, the microprocessor may executevarious operating system instructions as well as software routinesconfigured to effect certain processes and stored in or provided by amanufacture including a computer readable-medium, such as a memorydevice (e.g., a random access memory (RAM) of a personal computer) orone or more mass storage devices (e.g., an internal or external harddrive, a solid-state storage device, CD-ROM, DVD, or other storagedevice). In addition, the microprocessor may process data provided asinputs for various routines or software programs, such as data providedas part of the present techniques in computer-based implementations.

Such data associated with the present techniques may be stored in, orprovided by, the memory or mass storage device of the processor-basedsystem that may encompass all or part of the data acquisition circuitry42, database 44, and/or data processing circuitry 46. Alternatively,such data may be provided to the microprocessor of the processor-basedsystem via one or more input devices. In one embodiment, the dataacquisition circuitry 42 may represent one such input device; however,the input devices may also include manual input devices, such as akeyboard, a mouse, or the like. In addition, the input devices mayinclude a network device, such as a wired or wireless Ethernet card, awireless network adapter, or any of various ports or devices configuredto facilitate communication with other devices via any suitablecommunications network, such as a local area network or the Internet.Through such a network device, the processor-based system may exchangedata and communicate with other networked electronic systems, whetherproximate to or remote from the system. The network may include variouscomponents that facilitate communication, including switches, routers,servers or other computers, network adapters, communications cables, andso forth.

Processing in accordance with techniques of the present disclosure maybegin when the measurements of the magnetic field {right arrow over(B)}, obtained by the magnetometer 30, are received at the surface 40 bythe data acquisition circuitry 42. As noted above, the magnetometer 30may obtain three-axis measurements of the magnetic field {right arrowover (B)}; though the three axes of the magnetometer 30 may notgenerally be aligned with the (x,y,z) coordinate system of the magneticdipole 28, the data acquisition circuitry 42 or the data processingcircuitry 46 may rotate the three-axis magnetometer 30 readings into the(x,y,z) coordinate system using known survey information for the twowells and a reading from the inclinometer 36. Henceforth, the threemagnetic field components may be understood to have been transformedinto the (x,y,z) coordinate system associated with the BHA 18 of theinjector well 12.

After receiving the measurements of the magnetic field {right arrow over(B)}, the data acquisition circuitry 42 may store the measurements inthe database 44 or transmit the measurements to the data processingcircuitry 46. In accordance with one or more stored routines, the dataprocessing circuitry 46 may employ the measurements of the magneticfield {right arrow over (B)}, in conjunction with MWD and/or LWD surveydata, to ascertain the relative location of the magnetometer 30 to therotating magnetic dipole 28 in the BHA 18. The data processing circuitry46 may thereafter output a relative location report 48, which may bestored in the database 44 or transmitted to a BHA control/MWD interface50. The relative location report 48 may indicate the location of themagnetometer 30 relative to the magnetic dipole 28 of the BHA 18 in the(x,y,z) coordinate system. Additionally or alternatively, the relativelocation report 48 may be provided to an operator via one or more outputdevices, such as an electronic display and/or a printer.

The BHA control/MWD interface 50 may communicate with the BHA 18 usingE-Pulse™-based electric pulse telemetry, mud pulse telemetry, or anyother telemetry system communication downlink. Through the communicationdownlink, the BHA control/MWD interface 50 may control the BHA 18, aswell as receive data obtained by the MWD and/or LWD tool 24; suchreceived data may be stored in the database 44 for use by the dataprocessing circuitry 46. In the presently illustrated embodiment, theBHA control/MWD interface 50 may automatically steer the drill bit 20based on the relative location report 48. Additionally or alternatively,an operator in control of the BHA control/MWD interface 50 may steer thedrill bit 20 based on the printed or electronically displayed relativelocation report 48.

FIGS. 2-7 generally illustrate the geometrical and magneticrelationships between the rotating magnetic dipole 28 in the BHA 18 andthe magnetometer 30. Particularly, FIGS. 2 and 3 illustrate thedisposition of the magnetic dipole 28 in the (x,y,z) coordinate systemand the resultant magnetic moments; FIGS. 4 and 5 illustrate geometricalrelationships between vectors to an observation point, from which themagnetic field {right arrow over (B)} caused by the magnetic dipole 28may be measured; and FIGS. 6A-C and 7A-C respectively illustrate thecomponents of the magnetic field {right arrow over (B)} due to the x andy components of the magnetic dipole as the magnetic dipole rotates.

Turning to FIG. 2, the magnetic dipole 28 can be modeled as a magneticdipole {right arrow over (M)} located in the BHA 18. A coordinate system(x,y,z) may be understood to attach to the BHA 18, such that thez-direction is along the axis of the BHA 18 which is generallyhorizontal, the x direction is generally up, and the y-direction isgenerally horizontal. Accordingly, in FIG. 2, the magnetic dipole 28(illustrated as a magnetic dipole {right arrow over (M)}) is located atthe origin of this coordinate system (x,y,z)=(0,0,0). The magneticdipole {right arrow over (M)} is transverse to the z-axis and makes anangle φ with respect to the x-axis. Note that φ is a function of time,which will be included later in the analysis. The BHA 18 may typicallyrotate at approximately 60 to 180 RPM, while the rate of penetrationthrough the formation 16 may be significantly slower, at approximately50 to 200 feet per hour. As such, the position of the BHA 18 may beassumed to be constant during the time of the measurement, such thattime dependence is only in φ. As shown in FIG. 3, the magnetic dipole{right arrow over (M)} can be written as the sum of two components,

{right arrow over (M)}=M _(x) ×+M _(y) y

where M_(x)=M cos φ and M_(y)=M sin φ.

FIGS. 4 and 5 describe relationships between vectors to an observationpoint 52, from which the magnetometer 30 may take readings of themagnetic field {right arrow over (B)} arising from the magnetic dipole28 (illustrated in FIGS. 2 and 3 as magnetic dipole {right arrow over(M)}). Particularly, FIG. 4 illustrates a vector {right arrow over (r)},located at an observation point (x,y,z) (x, y, z) relative to themagnetic dipole {right arrow over (M)} at the origin, and acorresponding transverse vector {right arrow over (ρ)}. Notably, FIG. 4provides the relationship between {right arrow over (r)} and {rightarrow over (ρ)} in three-dimensional space. Similarly, FIG. 5illustrates the geometry of transverse vector {right arrow over (ρ)} inthe x-y plane; the transverse vector {right arrow over (ρ)} may beunderstood to rotate an angle ψ from the x-axis toward the y-axis. Thegeometry illustrated by FIGS. 4 and 5 may be described using thefollowing mathematical relationships. As noted above, the magnetic fielddue to the magnetic dipole {right arrow over (M)} can be written as thesum of the magnetic fields due to the two components M_(x) and M_(y).The static magnetic field at an observation point {right arrow over (r)}due to a magnetic dipole {right arrow over (m)} may be given by

$\begin{matrix}{{{\overset{->}{B}\left( \overset{\rightharpoonup}{r} \right)} = {\frac{\mu_{0}}{4\; \pi \; r^{3}}\left\lbrack {{3\; {\hat{r}\left( {\hat{r}\; \overset{->}{m}} \right)}} - \overset{->}{m}} \right\rbrack}},} & (2)\end{matrix}$

where μ₀=4π·10⁻⁷ Henry/m, {right arrow over (r)}=xx+yy+z{circumflex over(z)}, and x, y, and {circumflex over (z)} are unit vectors in the x, y,and z directions. The magnitude of {right arrow over (r)} is thusr=√{square root over (x²+y²+z²)} and the unit vector pointing in the{right arrow over (r)} direction is {circumflex over (r)}={right arrowover (r)}/r. In addition, the transverse vector {right arrow over (ρ)}may be defined as {right arrow over (ρ)}=xx+yy, where ρ=√{square rootover (x²+y²)} and ρ={right arrow over (ρ)}/ρ.

FIGS. 6A-C and 7A-C respectively illustrate the components of themagnetic field {right arrow over (B)} due to the x and y components ofthe magnetic dipole {right arrow over (M)} as the magnetic dipole {rightarrow over (M)} rotates. As discussed above with reference to FIG. 1,the magnetic dipole 28 or other magnetic source (the magnetic dipole{right arrow over (M)}) may rotate with the BHA 18, and thus may rotatearound the z-axis in the x-y plane. As such, the magnetic field {rightarrow over (B)}, as measured from the observation point 52, may varywith the rotation of the magnetic dipole {right arrow over (M)} overtime. Particularly, FIGS. 6A-C illustrate the magnetic field {rightarrow over (B)} at a point in time when the magnetic dipole {right arrowover (M)} has rotated into alignment with the x-axis, and FIGS. 7A-Cillustrate the magnetic field {right arrow over (B)} at a point in timewhen the magnetic dipole {right arrow over (M)} has rotated intoalignment with the y-axis. In FIGS. 6A-C and 7A-C, the observation point52, from which the magnetic field {right arrow over (B)} may be measuredby the magnetometer 30, is located in the upper right quadrant of thex-z plane.

Referring first to FIGS. 6A-C, because the magnetic dipole {right arrowover (M)} has rotated into alignment with the x-axis, the magnetic field{right arrow over (B)} due to the magnetic dipole {right arrow over (M)}may be entirely due to the dipole component M_(x). The magnetic fielddue to the dipole component M_(x) may be calculated as follows.Substituting {right arrow over (m)}=M_(x)x=M cos φx into Equation (2)produces the results:

$\begin{matrix}{{{{\overset{->}{B}}_{x}\left( \overset{\rightharpoonup}{r} \right)} = {{{B_{xx}\left( \overset{\rightharpoonup}{r} \right)}x} + {{B_{xy}\left( \overset{\rightharpoonup}{r} \right)}y} + {{B_{xz}\left( \overset{\rightharpoonup}{r} \right)}\hat{z}}}};} & \left( {3a} \right) \\{{{B_{xx}\left( \overset{\rightharpoonup}{r} \right)} = {\frac{3\; \mu_{0}M\; \cos \; \varphi}{4\; \pi \; r^{5}}\left( {x^{2} - {r^{2}/3}} \right)}};} & \left( {3b} \right) \\{{{B_{xy}\left( \overset{\rightharpoonup}{r} \right)} = {\frac{3\; \mu_{0}M\; \cos \; \varphi}{4\; \pi \; r^{5}}({xy})}};{and}} & \left( {3c} \right) \\{{B_{xz}\left( \overset{\rightharpoonup}{r} \right)} = {\frac{3\; \mu_{0}M\; \cos \; \varphi}{4\; \pi \; r^{5}}{({xz}).}}} & \left( {3d} \right)\end{matrix}$

The first subscript (x) in Equations (3a) to (3d) refers to the magneticdipole component, while the second subscript (x, y, or z) refers to themagnetic field component. From Equations (3a)-(3d), the magnetic field{right arrow over (B)} due to the dipole component M_(x) may be shownfrom three perspective views in FIGS. 6A-C; in all FIGS. 6A-C, themagnetic dipole {right arrow over (M)} is aligned with the x-axis. FIG.6A illustrates the magnetic field {right arrow over (B)} due to thedipole component M_(x) in the x-z plane; FIG. 6B illustrates themagnetic field {right arrow over (B)} due to the dipole component M_(x)in the x-y plane; and FIG. 6C illustrates the magnetic field {rightarrow over (B)} due to the dipole component M_(x) in the y-z plane. Asshown in FIG. 6A, the observation point 52 is located in the upper rightquadrant of the x-z plane, and B_(xx) and B_(xz) are clearly nonzero asmeasured from the observation point 52. In fact, as described byEquations (3b) and (3d) above, the amplitudes of B_(xx) and B_(xz) aremaxima at the observation point 52 when the magnetic dipole {right arrowover (M)} has rotated into alignment with the x-axis and φ is zero. Incontrast, as shown in FIG. 6B, B_(xy) is zero as measured at theobservation point 52. This is also apparent from Equation (3c) with y=0.These conclusions are valid for any quadrant in the x-z plane. Thus,when the observation point 52 is in the x-z plane and the magneticdipole {right arrow over (M)} has rotated into alignment with thex-axis, the amplitudes of B_(xx) and B_(xz) maxima, while B_(xy) iszero.

Referring next to FIGS. 7A-C, because the magnetic dipole {right arrowover (M)} has rotated into alignment with the y-axis, the magnetic field{right arrow over (B)} due to the magnetic dipole {right arrow over (M)}may be entirely due to the dipole component M_(y). The magnetic fielddue to the dipole component M_(y) may be calculated as follows.Substituting {right arrow over (m)}=M_(y)y=M sin φy into Equation (2)produces the results:

$\begin{matrix}{{{{\overset{->}{B}}_{y}\left( \overset{\rightharpoonup}{r} \right)} = {{{B_{yx}\left( \overset{\rightharpoonup}{r} \right)}x} + {{B_{yy}\left( \overset{\rightharpoonup}{r} \right)}y} + {{B_{yz}\left( \overset{\rightharpoonup}{r} \right)}\hat{z}}}};} & \left( {4a} \right) \\{{{B_{yx}\left( \overset{\rightharpoonup}{r} \right)} = {\frac{3\; \mu_{0}M\; \sin \; \varphi}{4\; \pi \; r^{5}}({xy})}};} & \left( {4b} \right) \\{{{B_{yy}\left( \overset{\rightharpoonup}{r} \right)} = {\frac{3\; \mu_{0}M\; \sin \; \varphi}{4\; \pi \; r^{5}}\left( {y^{2} - {r^{2}/3}} \right)}};{and}} & \left( {4c} \right) \\{{B_{yz}\left( \overset{\rightharpoonup}{r} \right)} = {\frac{3\; \mu_{0}M\; \sin \; \varphi}{4\; \pi \; r^{5}}{({yz}).}}} & \left( {4d} \right)\end{matrix}$

The first subscript (y) in Equations (4a)-(4d) refers to the magneticdipole component, while the second subscript (x, y, or z) refers to themagnetic field component. From Equations (4a)-(4d3a)-(3d), the magneticfield {right arrow over (B)} due to the dipole component M_(y) may beshown from three perspective views in FIGS. 7A-C; in all FIGS. 7A-C, themagnetic dipole {right arrow over (M)} is aligned with the y-axis. FIG.7A illustrates the magnetic field {right arrow over (B)} due to thedipole component M_(y) in the x-z plane; FIG. 7B illustrates themagnetic field {right arrow over (B)} due to the dipole component M_(y)in the x-y plane; and FIG. 7C illustrates the magnetic field {rightarrow over (B)} due to the dipole component M_(y) in the y-z plane. Asshown in FIGS. 7B and 7C, B_(yx) and B_(yz) are clearly zero as measuredfrom the observation point 52. As described by Equations (4b)-(4d)above, B_(yx) and B_(yz) are zero when the magnetic dipole {right arrowover (M)} has rotated into alignment with the y-axis and φ is π/2. Thismay also be seen from Equations (4b) and (4d) with y=0. When themagnetic dipole {right arrow over (M)} is in the same location, theamplitude of B_(yy) reaches a maximum, as measured from the observationpoint 52. Thus, when the observation point 52 is in the x-z plane andthe magnetic dipole {right arrow over (M)} has rotated into alignmentwith the y-axis, B_(yy) reaches a maximum, while B_(yx) and B_(yz) arezero.

The total magnetic field for any angle φ of the magnetic dipole {rightarrow over (M)} may be given by adding the magnetic fields from eachmagnetic dipole component:

$\begin{matrix}{{{\overset{->}{B}\left( \overset{\rightharpoonup}{r} \right)} = {{{{B_{x}\left( \overset{\rightharpoonup}{r} \right)}x} + {{B_{y}\left( \overset{\rightharpoonup}{r} \right)}y} + {{B_{z}\left( \overset{\rightharpoonup}{r} \right)}\hat{z}}} = {{{\overset{->}{B}}_{x}\left( \overset{\rightharpoonup}{r} \right)} + {{\overset{->}{B}}_{y}\left( \overset{\rightharpoonup}{r} \right)}}}};} & \left( {5a} \right) \\{{{B_{x}\left( \overset{\rightharpoonup}{r} \right)} = {\frac{3\; \mu_{0}M}{4\; \pi \; r^{5}}\left\lbrack {{\left( {x^{2} - {r^{2}/3}} \right)\cos \; \varphi} + {({xy})\sin \; \varphi}} \right\rbrack}};} & \left( {5b} \right) \\{{{B_{y}\left( \overset{\rightharpoonup}{r} \right)} = {\frac{3\; \mu_{0}M}{4\; \pi \; r^{5}}\left\lbrack {{({xy})\cos \; \varphi} + {\left( {y^{2} - {r^{2}/3}} \right)\sin \; \varphi}} \right\rbrack}};{and}} & \left( {5c} \right) \\{{B_{z}\left( \overset{\rightharpoonup}{r} \right)} = {{\frac{3\; \mu_{0}M}{4\; \pi \; r^{5}}\left\lbrack {{({xz})\cos \; \varphi} + {({yz})\sin \; \varphi}} \right\rbrack}.}} & \left( {5d} \right)\end{matrix}$

For the situations shown in FIGS. 6A-C and 7A-C, the position of theobservation point 52 relative to the magnetometer 30 can be deducedprovided one knows when the magnetic dipole {right arrow over (M)} isaligned with the x-axis and when it is aligned with the y-axis. As themagnetic dipole rotates about the z-axis, the magnetic field is measuredat the observation point 52. Referring to FIGS. 6A-C, the amplitudes ofthe magnetic field components |B_(x)({right arrow over (r)})| and|B_(z)({right arrow over (r)})| achieve their maximum amplitudes whenφ=0, i.e. when the magnetic dipole {right arrow over (M)} is alignedwith the x-axis. At the same instant B_(x)({right arrow over (r)}) iszero. Referring to FIGS. 7A-C, both magnetic field componentsB_(x)({right arrow over (r)}) and B_(z)({right arrow over (r)}) are zerowhen φ=π/2, i.e. when the magnetic dipole {right arrow over (M)} isaligned with the y-axis. At the same instant, |B_(y)({right arrow over(r)})| achieves its maximum value. Note that B_(x)({right arrow over(r)}) and B_(z)({right arrow over (r)}) are in-phase since they achievetheir maximum and minimum amplitudes at the same times. Hence, bymeasuring the magnetic field components as the magnetic dipole {rightarrow over (M)} rotates, and by observing when the amplitudes of fieldcomponents are maxima and minima, one can determine the two instantswhen φ=0 and φ=π/2.

Furthermore, once these two instants when φ=0 and φ=π/2 are determined,the magnetic field components can be used to deduce the position of theobservation point 52. When φ=0, the nonzero magnetic field componentsare

${{B_{x}\left( \overset{\rightharpoonup}{r} \right)} = {{{\frac{3\; \mu_{0}M}{4\; \pi \; r^{5}}\left\lbrack {x^{2} - {r^{2}/3}} \right\rbrack}\mspace{14mu} {and}\mspace{14mu} {B_{z}\left( \overset{\rightharpoonup}{r} \right)}} = {\frac{3\; \mu_{0}M}{4\; \pi \; r^{5}}\lbrack{xz}\rbrack}}},$

while the nonzero magnetic field component for φ=π/2 is

${B_{y}\left( \overset{\rightharpoonup}{r} \right)} = {{\frac{3\; \mu_{0}M}{4\; \pi \; r^{5}}\left\lbrack {r^{2}/3} \right\rbrack}.}$

Once these three magnetic field components are measured, these equationscan be solved for x and z, given that the value for M is known. As y=0was initially assumed, the problem is over determined, i.e. only twomeasurements are needed to obtain the two unknown quantities, x and z.

In the general case, the observation point may not be in the x-z planeand will have a nonzero value for y. Thus x, y and z are three unknownquantities and they must be determined from at least three measurements.From the previous paragraph, the three measured magnetic fieldcomponents provide is sufficient information to determine these threeunknown quantities. For any value of y, there is a plane that includesthe z-axis and the observation point 52. Referring to FIGS. 8 and 9,this plane may be denoted by a primed coordinate system (x′,y′,z) wherethe x′-axis and the z-axis define the plane containing the observationpoint 52, and where the y′-axis is orthogonal to the plane. The x′ andy′ axes are obtained by rotation of the x and y axes by an angle θ aboutthe z-axis. Since y′=0 in the rotated coordinate system, the situationin the rotated coordinate system is similar to that illustrated in FIGS.6A-C and 7A-C, except that x is replaced by x′ and y is replaced by y′in these figures.

FIG. 10 is a flowchart 54 that sets forth a general method, based on therelationships illustrated in Equations (5a) to (5d) and in FIGS. 6A-C,7A-C, 8 and 9 above, for determining the relative location of theobservation point 52 to the origin. As noted above, the observationpoint 52 represents the location of the magnetometer 30, while theorigin represents the location of the magnetic dipole 28. Equations (5a)to (5d) may be employed to determine the location of the observationpoint 52 with respect to the origin. Accordingly, the present disclosureprovides techniques for processing the measurements of the magneticfield {right arrow over (B)} obtained by the magnetometer 30. Theflowchart 54 of FIG. 10 generally describes how such techniques may beused to determine the relative location of the magnetometer 30 to themagnetic dipole 28.

In a first step 56, the magnetometer 30 may take a series ofmeasurements of the magnetic field {right arrow over (B)} over apredetermined period of time (e.g., 1-2 seconds or one or more periodsof rotation of the magnetic dipole 28). If the magnetometer 30 in theproducer well 14 is not completely aligned with the (x,y,z) coordinatesystem of the magnetic dipole 28 in the injector well 12, the rawmeasurements from the magnetometer 30 may be transformed into the(x,y,z) coordinate system using known survey information for the twowells and a reading from the inclinometer 36.

In step 58, the data processing circuitry 46 may receive themeasurements of the magnetic field {right arrow over (B)} in the (x,y,z)coordinate system over the predetermined period of time. To takeadvantage of Equations (5a) to (5d), the data processing circuitry 46may rotate the magnetic field measurements by an angle θ from the(x,y,z) coordinate system into the (x′,y′,z) coordinate system. Theangle of rotation θ is determined by requiring the magnetic component inthe x′ direction be in-phase with the magnetic field component in the zdirection. Equivalently, the angle of rotation θ is chosen such that themaxima and minima of the magnetic component in the x′ direction and thez direction occur at the same instants. It should be appreciated that avariety of techniques may be employed to determine a proper angle ofrotation of the reference frame, many of which are described in greaterdetail below.

In step 60, the relative location of the magnetometer 30 to the magneticdipole 28 may be determined from the transformed measurements of themagnetic field {right arrow over (B)} in the rotated frame of reference.Particularly, as will be described in greater detail below, the dataprocessing circuitry 38 may determine the relative location based on theangle of rotation of the frame of reference and the amplitudes of themagnetic field {right arrow over (B)} in the rotated frame of reference.

The rotation angle θ may be determined by measuring the three componentsof the magnetic field at the observation point 52 as a function of time.Since the magnetic dipole {right arrow over (M)} is rotating, there willbe instances where it is aligned with the x′-axis and times when it isaligned with the y′-axis. These instances may be determined by imposingconditions on the magnetic field components. For example, when themagnetic field component in the x′ direction is in-phase with themagnetic field component in the z direction, the situation is analogousto FIGS. 6A-C. Here, in-phase means that the maximum amplitudes of thetwo field components occur at the same time, or that the minimumamplitudes of the two field components occur at the same time.

FIGS. 11-12 illustrate an example for performing the general algorithmof FIG. 10 in an exemplary case when the magnetic dipole 28 rotates at aconstant frequency. The following analysis from Equations (5)-(13) mayprovide a framework for understanding FIGS. 11-12, which are discussedin greater detail below

Equations (5b), (5c), and (5d) can be recast in forms that explicitlydisplay their phases. First, an angle α may be defined such that:

$\begin{matrix}{{{\cos \; \alpha} = \frac{x^{2} - {r^{3}/3}}{\sqrt{{x^{2}y^{2}} + \left( {x^{2} - {r^{2}/3}} \right)^{2}}}};} & \left( {6a} \right) \\{{{\sin \; \alpha} = \frac{xy}{\sqrt{{x^{2}y^{2}} + \left( {x^{2} - {r^{2}/3}} \right)^{2}}}};\mspace{14mu} {and}} & \left( {6b} \right) \\{{\tan \; \alpha} = {\frac{xy}{x^{2} - {r^{2}/3}}.}} & \left( {6c} \right)\end{matrix}$

Equation (5b) can be rewritten as:

$\begin{matrix}{{{B_{x}\left( {\overset{\rightharpoonup}{r},t} \right)} = {\frac{3\mu_{0}M}{4\pi \; r^{5}}{\sqrt{{x^{2}y^{2}} + \left( {x^{2} - {r^{2}/3}} \right)^{2}}\left\lbrack {{\cos \; \alpha \; \cos \; \varphi} + {\sin \; \alpha \; \sin \; \varphi}} \right\rbrack}}},\mspace{20mu} {or}} & \left( {7a} \right) \\{\mspace{20mu} {{B_{x}\left( {\overset{\rightharpoonup}{r},t} \right)} = {\frac{3\mu_{0}M}{4\pi \; r^{5}}\sqrt{{x^{2}y^{2}} + \left( {x^{2} - {r^{2}/3}} \right)^{2}}{{\cos \left( {\varphi - \alpha} \right)}.}}}} & \left( {7b} \right)\end{matrix}$

An angle β may be defined such that:

$\begin{matrix}{{{\cos \; \beta} = \frac{xy}{\sqrt{{x^{2}y^{2}} + \left( {y^{2} - {r^{2\;}/3}} \right)^{2}}}};} & \left( {8a} \right) \\{{{{\sin \; \beta} = \frac{y^{2} - {r^{2}/3}}{\sqrt{{x^{2}y^{2}} + \left( {y^{2} - {r^{2}/3}} \right)^{2}}}};}{and}} & \left( {8b} \right) \\{{\tan \; \beta} = {\frac{y^{2} - {r^{2}/3}}{xy}.}} & \left( {8c} \right)\end{matrix}$

Equation (5c) can be rewritten as:

$\begin{matrix}{{B_{y}\left( {\overset{\rightharpoonup}{r},t} \right)} = {\frac{3\mu_{0}M}{4\pi \; r^{5}}\sqrt{{x^{2}y^{2}} + \left( {y^{2} - {r^{2}/3}} \right)^{2}}\cos \; {\left( {\varphi - \beta} \right).}}} & (9)\end{matrix}$

An angle γ may be defined such that:

$\begin{matrix}{{{\cos \; \gamma} = \frac{x}{\sqrt{{x^{2} + y^{2}}\;}}};} & \left( {10a} \right) \\{{{{\sin \; \gamma} = \frac{y}{\sqrt{x^{2} + y^{2}}}};}{and}} & \left( {10b} \right) \\{{\tan \; \gamma} = {\frac{y}{x}.}} & \left( {10c} \right)\end{matrix}$

Equation (5d) can be rewritten as:

$\begin{matrix}{{B_{z}\; \left( {\overset{\rightharpoonup}{r},t} \right)} = {\frac{3\mu_{0}M}{4\pi \; r^{5}}z\sqrt{x^{2} + y^{2}}\cos \; {\left( {\varphi - \gamma} \right).}}} & (11)\end{matrix}$

In summary, the three magnetic field components are:

$\begin{matrix}{{{B_{x}\; \left( {\overset{\rightharpoonup}{r},t} \right)} = {{B_{{ox}\;}\left( \overset{\rightharpoonup}{r} \right)}{\cos \left( {\varphi - \alpha} \right)}}},{{{{where}\mspace{14mu} {B_{{ox}\;}\left( \overset{\rightharpoonup}{r} \right)}} = {\frac{3\mu_{0}M}{4\pi \; r^{5}}\sqrt{{x^{2}y^{2}} + \left( {x^{2} - {r^{2}/3}} \right)^{2}}}};}} & \left( {12a} \right) \\{{{{B_{y}\left( {\overset{\rightharpoonup}{r},t} \right)} = {{B_{oy}\left( \overset{\rightharpoonup}{r} \right)}{\cos \left( {\varphi - \beta} \right)}}},{{{{where}\mspace{14mu} {B_{oy}\left( \overset{\rightharpoonup}{r} \right)}} = {\frac{3\mu_{0}M}{4\pi \; r^{5}}\sqrt{{x^{2}y^{2}} + \left( {y^{2} - {r^{2}/3}} \right)^{2}}}};}}{and}} & \left( {12b} \right) \\{{{B_{z\;}\left( {\overset{\rightharpoonup}{r},t} \right)} = {{B_{o\; z}\left( \overset{\rightharpoonup}{r} \right)}\; {\cos \left( {\varphi - \gamma} \right)}}},{{{where}\mspace{14mu} {B_{o\; z}\left( \overset{\rightharpoonup}{r} \right)}} = {\frac{3\mu_{0}M}{4\pi \; r^{5}}z{\sqrt{x^{2} + y^{2}}.}}}} & \left( {12c} \right)\end{matrix}$

As discussed above, the magnetic dipole 28 may be rotating about thez-axis at the origin in the x-y plane, and the z-axis is aligned withthe axis of the BHA 18. When the magnetic dipole 28 rotates at anapproximately constant frequency, φ(t)=(2πf)t=ωt , where f is thefrequency of rotation, and where ω=2πf is the angular frequency.However, as will be discussed further below, the techniques disclosedherein are not limited to this special case of constant frequency, butrather may be employed as long as the magnetic dipole is not stationaryabout the z-axis in the x-y plane.

The magnetic dipole 28 may be assumed to point in the +x direction attime t=0, because the technique disclosed herein relies not on absolutephases, but rather relative phases, among the three magnetic fieldcomponents. Because the magnetic dipole 28 rotates with time, themagnetic dipole 28 makes an angle φ(t)=ωt with respect to the x-axis attime t. For frequencies at or below 100 Hz, the magnetic field can beaccurately described as a quasi-static field. In other words, the timedependence is given by the following relationships:

$\begin{matrix}{{{B_{x}\; \left( {\overset{\rightharpoonup}{r},t} \right)} = {{B_{ox}\left( \overset{\rightharpoonup}{r} \right)}\cos \; \left( {{\omega \; t} - \alpha} \right)\mspace{14mu} {and}}}\text{}{{{B_{ox}\left( \overset{\rightharpoonup}{r} \right)} = {\frac{3\mu_{0}M}{4\pi \; r^{5}}\sqrt{{x^{2}y^{2}} + \left( {x^{2} - {r^{2}/3}} \right)^{2}}}};}} & \left( {13a} \right) \\{{{B_{y}\left( {\overset{\rightharpoonup}{r},t} \right)} = {{B_{oy}\left( \overset{\rightharpoonup}{r} \right)}{\cos \left( {{\omega \; t} - \beta} \right)}\mspace{14mu} {and}}}\text{}{{{B_{oy}\left( \overset{\rightharpoonup}{r} \right)} = {\frac{3\mu_{0}M}{4\pi \; r^{5}}\sqrt{{x^{2}y^{2}} + \left( {y^{2} - {r^{2}/3}} \right)^{2}}}};}{and}} & \left( {13b} \right) \\{{B_{z}\left( {\overset{\rightharpoonup}{r},t} \right)} = {{{B_{o\; z}\left( \overset{\rightharpoonup}{r} \right)}{\cos \left( {{\omega \; t} - \gamma} \right)}\mspace{14mu} {and}\mspace{14mu} {B_{o\; z}\left( \overset{\rightharpoonup}{r} \right)}} = {\frac{3\mu_{0}M}{4\pi \; r^{5}}z{\sqrt{x^{2} + y^{2}}.}}}} & \left( {13c} \right)\end{matrix}$

As noted above, FIGS. 11-12 illustrate an example for performing thegeneral algorithm of FIG. 10 in an exemplary case when the magneticdipole 28 rotates at a constant frequency. In the example of FIGS.11-12, f=3 Hz, M=100 Amp-m², and the coordinates of the observationpoint 52 are x=10 m, y=2 m, and z=10 m. Turning to FIG. 11, a plot 62represents an idealized measurement of the magnetic field {right arrowover (B)} over a period of one second based on the equations above. Anordinate 64 represents the ideal measurement of the magnetic fieldcomponents of {right arrow over (B)} in units of nanoTesla, and anabscissa 66 represents time in units of seconds. A dash-dotted linerepresents a measurement of B_(x)({right arrow over (r)},t), a dashedline represents a measurement of B_(y)({right arrow over (r)},t) and asolid line represents a measurement of B_(z)({right arrow over (r)},t).In the graph 62, the phases of the components are α=0.559 radians,β=−1.268 radians, and γ=0.197 radians, and the amplitudes areB_(ox)({right arrow over (r)})=1.91 nanoTesla, B_(oy)({right arrow over(r)})=3.38 nanoTesla, and B_(oz)({right arrow over (r)})=5.15 nanoTesla.

Because the observation point 52 may be located with respect to themagnetic dipole 28 using the three magnetic field components, measuredas functions of time t, the values M, B_(x)({right arrow over (r)},t),B_(y)({tilde over (r)},t), and B_(z)({right arrow over (r)},t) may betreated as known quantities, while the observation point {right arrowover (r)} may be treated as an unknown and to be determined. Note thatthere are three unknown quantities, x, y, and z. The solution may beobtained by finding an angle of rotation around the z-axis such thatB_(x)({right arrow over (r)},t) and B_(y)({right arrow over (r)},t) aretransformed into magnetic field components H_(x)({right arrow over(r)},t) and H_(y)({right arrow over (r)},t) in which H_(x)({right arrowover (r)},t) is in phase with B_(z)({right arrow over (r)},t).Specifically, such a transverse angle of rotation θ may be definedaccording to the following equation:

$\begin{matrix}{{\begin{bmatrix}{H_{x}\left( {\overset{\rightharpoonup}{r},t} \right)} \\{H_{y}\left( {\overset{\rightharpoonup}{r},t} \right)}\end{bmatrix} = {\begin{bmatrix}{\cos \; \theta} & {\sin \; \theta} \\{{- \sin}\; \theta} & {\cos \; \theta}\end{bmatrix}\begin{bmatrix}{B_{x\;}\left( {\overset{\rightharpoonup}{r},t} \right)} \\{B_{y}\left( {\overset{\rightharpoonup}{r},t} \right)}\end{bmatrix}}},} & (14)\end{matrix}$

such that H_(x)({right arrow over (r)},t) is in phase with B_(z)({rightarrow over (r)},t).

In Equation (14), H_(x)({right arrow over (r)},t) and H_(y)({right arrowover (r)},t) denote magnetic field components in the rotated frame,while B_(x)({right arrow over (r)},t) and B_(y)({right arrow over(r)},t) represent magnetic field components in the original frame. Sincethe rotation is about the z-axis, the magnetic field component in the zdirection is the same in both frames. B_(z)({right arrow over (r)},t)may be expanded as follows:

B _(z)({right arrow over (r)},t)=B _(oz)(r)cos(ωt−γ)=B _(oz)({rightarrow over (r)})[cos(ωt)cos γ+sin(ωt)sin γ]

B _(z)({right arrow over (r)},t)=B _(oz)({right arrow over (r)})cosγ{cos(ωt)+sin(ωt)tan γ}  (15).

Substituting Equations (13a) and (13b) into Equation (14), the followingrelationship may be written:

$\begin{matrix}{{H_{x}\left( {\overset{\rightharpoonup}{r},t} \right)} = {{\cos \; \theta \left\{ {\frac{3\mu_{0}M}{4\pi \; r^{5}}\sqrt{{x^{2}y^{2}} + \left( {x^{2} - {r^{2}/3}} \right)^{2}}{\cos \left( {{\omega \; t} - \alpha} \right)}} \right\}} + {\sin \; \theta {\left\{ {\frac{3\mu_{0}M}{4\pi \; r^{5}}\sqrt{{{x^{2}y^{2}} + \left( {y^{2} - {r^{2}/3}} \right)^{2}}\;}\cos \; \left( {{\omega \; t} - \beta} \right)} \right\}.}}}} & (16)\end{matrix}$

Based on a trigonometric identity and Equation (6), the followingrelationship may be written:

$\begin{matrix}{\mspace{79mu} {{{\cos \; \left( {{\omega \; t} - \alpha} \right)} = {{{\cos \left( {\omega \; t} \right)}\cos \; \alpha} + {{\sin \left( {\omega \; t} \right)}\sin \; \alpha}}}{{\cos \left( {{\omega \; t} - \alpha} \right)} = {{\cos \; \left( {\omega \; t} \right)\frac{x^{2} - {r^{2}/3}}{\sqrt{{x^{2}y^{2}} + \left( {x^{2} - {r^{2}/3}} \right)^{2}}}} + {{\sin \left( {\omega \; t} \right)}\; {\frac{xy}{\sqrt{{x^{2}y^{2}} + \left( {x^{2} - {r^{2}/3}} \right)^{2}}}.}}}}}} & (17)\end{matrix}$

Similarly, using the same trigonometric identity and Equation (8), thefollowing relationship may be written:

$\begin{matrix}{{\cos \left( {{\omega \; t} - \beta} \right)} = {{{\cos \left( {\omega \; t} \right)}\frac{xy}{\sqrt{{x^{2}y^{2}} + \left( {y^{2} - {r^{2}/3}} \right)^{2}}}} + {{\sin \left( {\omega \; t} \right)}{\frac{\; {x^{2} - {r^{2}/3}}}{\sqrt{{x^{2}y^{2}} + \left( {y^{2} - {r^{2}/3}} \right)^{2}}}.}}}} & (18)\end{matrix}$

Inserting Equations (17) and (18) into Equation (16) provides thefollowing relationship:

${{H_{x}\left( {\overset{\rightharpoonup}{r},t} \right)} = {\frac{3\mu_{0}M}{4\pi \; r^{5}}\begin{Bmatrix}{{\cos \; {\theta \left\lbrack {{\left( {x^{2} - {r^{2}/3}} \right){\cos \left( {\omega \; t} \right)}} + {({xy}){\sin \left( {\omega \; t} \right)}}} \right\rbrack}} +} \\{\sin \; {\theta \left\lbrack {{({xy}){\cos \left( {\omega \; t} \right)}} + {\left( {y^{2} - {r^{2}/3}} \right){\sin \left( {\omega \; t} \right)}}} \right\rbrack}}\end{Bmatrix}}},$

whose terms may be rearranged as follows:

${{H_{x}\left( {\overset{\rightharpoonup}{r},t} \right)} = {\frac{3\mu_{0}M}{{4\pi \; r^{5}}\;}\begin{Bmatrix}{{\cos \; {\left( {\omega \; t} \right)\left\lbrack {{\left( {x^{2} - {r^{2}/3}} \right)\cos \; \theta} + {({xy})\sin \; \theta}} \right\rbrack}} +} \\{{\sin \left( {\omega \; t} \right)}\left\lbrack {{({xy})\cos \; \theta} + {\left( {y^{2} - {r^{2}/3}} \right)\sin \; \theta}} \right\rbrack}\end{Bmatrix}}},$

wherein the cos θ term may be factored to produce the following:

$\begin{matrix}{{H_{x}\left( {\overset{\rightharpoonup}{r},t} \right)} = {\frac{3\mu_{0}M}{4\pi \; r^{5}}\cos \; \theta {\begin{Bmatrix}{{{\cos \left( {\omega \; t} \right)}\left\lbrack {\left( {x^{2} - {r^{2}/3}} \right) + {({xy})\tan \; \theta}} \right\rbrack} +} \\{\sin \; {\left( {\omega \; t} \right)\left\lbrack {({xy}) + {\left( {y^{2} - {r^{2}/3}} \right)\tan \; \theta}} \right\rbrack}}\end{Bmatrix}.}}} & (19)\end{matrix}$

By factoring the first term of Equation (19) in square brackets, thefollowing equation may be written:

$\begin{matrix}{{H_{x}\left( {\overset{\rightharpoonup}{r},t} \right)} = {\frac{3\mu_{0}M}{4\pi \; r^{5}}\cos \; {{\theta \left\lbrack {\left( {x^{2} - {r^{2}/3}} \right) + {({xy})\tan \; \theta}} \right\rbrack} \cdot {\left\{ {{\cos \; \left( {\omega \; t} \right)} + {{\sin \left( {\omega \; t} \right)}\; \frac{\left\lbrack {({xy}) + {\left( {y^{2} - {r^{2}/3}} \right)\tan \; \theta}} \right\rbrack}{\left\lbrack {\left( {x^{2} - {r^{2}/3}} \right) + {({xy})\tan \; \theta}} \right\rbrack}}} \right\}.}}}} & (20)\end{matrix}$

Comparing Equations (15) and (20), H_(x)({right arrow over (r)},t) willbe in phase with B_(z)({right arrow over (r)},t) if the followingrelationship is satisfied:

$\begin{matrix}{\frac{\left\lbrack {({xy}) + {\left( {y^{2} - {r^{2}/3}} \right)\tan \; \theta}} \right\rbrack}{\left\lbrack {\left( {x^{2} - {r^{2}/3}} \right) + {({xy})\tan \; \theta}} \right\rbrack} = {{\tan \; \gamma} = {\frac{y}{x}.}}} & (21)\end{matrix}$

Equation (21) may be solved to yield the following:

$\begin{matrix}{{{\tan \; \theta} = {{\tan \; \gamma} = \frac{y}{x}}},} & (22)\end{matrix}$

or, more simply:

θ=+γ+n·π  (23),

where n is an integer.

Note that the ambiguity in direction (n·π) is not an impediment inlocating the observation point 52 in a practical drilling situation,since the general direction from the observation point 52 to themagnetic dipole 28 will be known. Applying the rotation angle fromEquation (22) to Equation (19) may yield the following:

${{H_{x}\left( {\overset{\rightarrow}{r},t} \right)} = {\frac{3\mu_{0}M}{4\pi \; r^{5}}\cos \; \theta \left\{ {{{\cos \left( {\omega \; t} \right)}\left\lbrack {\left( {x^{2} - {r^{2}/3}} \right) + {({xy})\left( \frac{y}{x} \right)}} \right\rbrack} + {{\sin \left( {\omega \; t} \right)}\left\lbrack {({xy}) + {\left( {y^{2} - {r^{2}/3}} \right)\left( \frac{y}{x} \right)}} \right\rbrack}} \right\}}},$

which may be rearranged and simplified as follows:

$\begin{matrix}{{H_{x}\left( {\overset{\rightarrow}{r},t} \right)} = {\frac{3\mu_{0}M}{4\pi \; r^{5}}\left( {{\frac{2}{3}r^{2}} - z^{2}} \right){{\cos \left( {{\omega \; t} - \theta} \right)}.}}} & (24)\end{matrix}$

When Equation (22) is satisfied, H_(y)({right arrow over (r)},t) is π/2radians out-of-phase with B_(z)({right arrow over (r)},t). Todemonstrate this, substitute Equations (13a) and (13b) into Equation(14):

${{H_{x}\left( {\overset{\rightarrow}{r},t} \right)} = {{{- \sin}\; \theta \frac{3\mu_{0}M}{4\pi \; r^{5}}\sqrt{{x^{2}y^{2}} + \left( {x^{2} - {r^{2}/3}} \right)^{2}}{\cos \left( {{\omega \; t} - \alpha} \right)}} + {\cos \; \theta \frac{3\mu_{0}M}{4\pi \; r^{5}}\sqrt{{x^{2}y^{2}} + \left( {y^{2} - {r^{2}/3}} \right)^{2}}{\cos \left( {{\omega \; t} - \beta} \right)}}}},$

insert Equations (17) and (18):

${{H_{y}\left( {\overset{\rightarrow}{r},t} \right)} = {\frac{3\mu_{0}M}{4\pi \; r^{5}}\left\{ {{{- \sin}\; {\theta \left\lbrack {{\left( {x^{2} - {r^{2}/3}} \right){\cos \left( {\omega \; t} \right)}} + {({xy})\sin \left\{ {\omega \; t} \right)}} \right\rbrack}} + {\cos \; {\theta \left\lbrack {{({xy}){\cos \left( {\omega \; t} \right)}} + {\left( {y^{2} - {r^{2}/3}} \right){\sin \left( {\omega \; t} \right)}}} \right\rbrack}}} \right\}}};$${{H_{y}\left( {\overset{\rightarrow}{r},t} \right)} = {\frac{3\mu_{0}M}{4\pi \; r^{5}}\left\{ {{{\cos \left( {\omega \; t} \right)}\left\lbrack {{{- \left( {x^{2} - {r^{2}/3}} \right)}\sin \; \theta} + {({xy})\cos \; \theta}} \right\rbrack} + {{\sin \left( {\omega \; t} \right)}\left\lbrack {{{- ({xy})}\sin \; \theta} + {\left( {y^{2} - {r^{2}/3}} \right)\cos \; \theta}} \right\rbrack}} \right\}}};$

and factor the cos θ term and using Equation (22) for tan θ:

$\begin{matrix}{{{H_{y}\left( {\overset{\rightarrow}{r},t} \right)} = {\frac{3\mu_{0}M}{4\pi \; r^{5}}\cos \; \theta \left\{ {{{\cos \left( {\omega \; t} \right)}\left\lbrack {{{- \left( {x^{2} - {r^{2}/3}} \right)}\frac{y}{x}} + ({xy})} \right\rbrack} + {{\sin \left( {\omega \; t} \right)}\left\lbrack {{{- ({xy})}\frac{y}{x}} + \left( {y^{2} - {r^{2}/3}} \right)} \right\rbrack}} \right\}}}\mspace{79mu} {{H_{y}\left( {\overset{\rightarrow}{r},t} \right)} = {\frac{3\mu_{0}M}{4\pi \; r^{5}}\cos \; \theta \left\{ {{{\cos \left( {\omega \; t} \right)}\left\lbrack \frac{r^{2}y}{3x} \right\rbrack} + {{\sin \left( {\omega \; t} \right)}\left\lbrack {- \frac{r^{2}}{3}} \right\rbrack}} \right\}}}\begin{matrix}{\mspace{79mu} {{H_{y}\left( {\overset{\rightarrow}{r},t} \right)} = {\frac{\mu_{0}M}{4\pi \; r^{3}}\cos \; \theta \left\{ {{{\cos \left( {\omega \; t} \right)}\frac{y}{x}} - {\sin \left( {\omega \; t} \right)}} \right\}}}} \\{= {\frac{\mu_{0}M}{4\pi \; r^{3}}\cos \; \theta \left\{ {{{\cos \left( {\omega \; t} \right)}\tan \; \theta} - {\sin \left( {\omega \; t} \right)}} \right\}}}\end{matrix}\begin{matrix}{\mspace{79mu} {{H_{y}\left( {\overset{\rightarrow}{r},t} \right)} = {\frac{\mu_{0}M}{4\pi \; r^{3}}\left\{ {{{\cos \left( {\omega \; t} \right)}\sin \; \theta} - {{\sin \left( {\omega \; t} \right)}\cos \; \theta}} \right\}}}} \\{= {{- \frac{\mu_{0}M}{4\pi \; r^{3}}}{{\sin \left( {{\omega \; t} - \theta} \right)}.}}}\end{matrix}} & (25)\end{matrix}$

With the condition tan θ=tan γ and comparing Equation (25) toB_(z)({right arrow over (r)},t)=B_(oz)({right arrow over (r)})cos(ωt−γ),it is clear that H_(y)({right arrow over (r)},t) is π/2 radiansout-of-phase with B_(z)({right arrow over (r)},t).

The above-described situation may be understood by referring again tothe magnetic field lines of FIGS. 6A-C and 7A-C. For example, considerthe instant when the magnetic dipole 28 is aligned with the +x axis asillustrated in FIGS. 6A-C. Note that under the above-describedconditions, the observation point 52 may be located in the upper rightquadrant of the x-z plane (i.e., at a point (x,0,z)). Referring to FIG.6A, the magnetic field components B_(z)({right arrow over (r)},t) andB_(x)({right arrow over (r)},t) will reach maximum amplitudes when themagnetic dipole 28 is aligned with the +x axis, as illustrated. However,the magnetic field component B_(y)({right arrow over (r)},t) will bezero at this instant, as indicated by FIG. 6B. At the instant when themagnetic dipole 28 is aligned with the +y axis, as illustrated in FIGS.7A-C, the magnetic field component B_(y)({right arrow over (r)},t) willreach a maximum amplitude at the observation point 52. This circumstanceis apparent in FIG. 7B. Meanwhile, magnetic field componentsB_(z)({right arrow over (r)},t) and B_(x)({right arrow over (r)}, t)will be zero at this instant, as indicated by FIGS. 7B and 7C. Hence,B_(x)({right arrow over (r)},t) is in-phase with B_(z)({right arrow over(r)},t), while B_(y)({right arrow over (r)},t) is π/2 radiansout-of-phase with B_(z)({right arrow over (r)},t). However, thiscondition exists only for observation points in the x-z plane. Forpoints off the x-z plane, the rotation of B_(x)({right arrow over(r)},t) and B_(y)({right arrow over (r)},t) to H_(x)({right arrow over(r)},t) and H_(y)({right arrow over (r)},t) described by Equations (14)and (22) should be applied.

FIG. 8 illustrates a relationship between the transverse vector {rightarrow over (ρ)} from the origin, which represents the location of themagnetic dipole 28, to the observation point 52, which represents thelocation of the magnetometer 30. According to Equation (10), and asillustrated in FIG. 8, the angle between {right arrow over (ρ)} and x isγ=tan⁻¹(y/x). Thus, because the condition for H_(x)({right arrow over(r)},t) to be in phase with B_(z)({right arrow over (r)},t) is given byEquation (22), tan θ=tan γ, the desired phase coherence may be obtainedwhen frame of reference is rotated by the angle θ from the x-axis. FIG.9 illustrates the situation where a rotated (x′,y′,z) coordinate systemis defined when the (x,y,z) coordinate system is rotated by the angle θ,according to the following relationship:

$\begin{matrix}{\begin{bmatrix}x^{\prime} \\y^{\prime}\end{bmatrix} = {{\begin{bmatrix}{\cos \; \theta} & {\sin \; \theta} \\{{- \sin}\; \theta} & {\cos \; \theta}\end{bmatrix}\begin{bmatrix}x \\y\end{bmatrix}}.}} & (26)\end{matrix}$

Thus, when the observation point is located off of the x-z plane by anangle γ, rotating the coordinate system by an angle θ=y+nπ provides therequired phase coherence. In the (x′,y′,z) coordinate systemH_(x)({right arrow over (r)},t) is in phase with B_(z)({right arrow over(r)},t).

FIG. 12 represents a plot 68 of the measurements of FIG. 11, rotated toa frame of reference such that H_(x)({right arrow over (r)},t) is inphase with B_(z)({right arrow over (r)},t). An ordinate 70 representsthe rotated measurement of the magnetic field in units of nanoTesla, andan abscissa 72 represents time in units of seconds. Recalling that thephases of the idealized measured magnetic field components are α=0.559radians, β=−1.268 radians, and γ=0.197 radians, rotating the magneticfield such that H_(x)({right arrow over (r)},t) is in phase withB_(z)({right arrow over (r)},t) may occur by applying Equation (14) withθ=0.197 radians to the data illustrated in the plot 62 of FIG. 11. Inthe resulting plot 68, a dash-dotted line represents the x′-component ofthe magnetic field, H_(x)({right arrow over (r)},t), a dashed linerepresents the y′-component of the magnetic field, H_(y)({right arrowover (r)},t), and a solid line represents the original z-component ofthe magnetic field, B_(z)({right arrow over (r)},t). Note thatH_(x)({right arrow over (r)},t) is in-phase with B_(z)({right arrow over(r)},t), while H_(y)({right arrow over (r)},t) is π/2 out-of-phase withB_(z)({right arrow over (r)},t).

FIG. 13 is a flowchart 74 that describes a manner of determining therelative location of the magnetometer 30 to the magnetic dipole 28 basedon the equations disclosed above. It should be appreciated that furtherembodiments are discussed below for several, more specific, situationsthat may arise while drilling a new well in the proximity of an existingwell. In a first step 76, the magnetometer 30 may take a series ofmeasurements of the magnetic field {right arrow over (B)} over apredetermined period of time (e.g., 1-2 seconds or one or more periodsof rotation of the magnetic dipole 28). If the magnetometer 30 in theproducer well 14 is not completely aligned with the (x,y,z) coordinatesystem of the magnetic dipole 28 in the injector well 12, in step 78,the raw measurements from the magnetometer 30 may be transformed intothe (x,y,z) coordinate system using known survey information for the twowells and a reading from the inclinometer 36.

In step 80, the data processing circuitry 46 may receive themeasurements of the magnetic field {right arrow over (B)} taken for thepredetermined period of time. The data processing circuitry 46 mayrotate the frame of reference of the measurements of the magnetic field{right arrow over (B)} such that the x′-component of the magnetic field,H_(x)({right arrow over (r)},t), is in phase with the z-component of themagnetic field, B_(z)({right arrow over (r)},t). It should be noted thatthe y′-component of the magnetic field, H_(y)({right arrow over (r)},t),may be π/2 out of phase with H_(x)({right arrow over (r)},t).

In step 82, the data processing circuitry 46 may determine theamplitudes of H_(x)({right arrow over (r)},t) and H_(y)({right arrowover (r)},t), as will be described further below. In step 84, the dataprocessing circuitry 46 may determine the relative location of themagnetometer 30 to the magnetic dipole 28 using the amplitudesdetermined in step 82 and the angle of rotation of the rotated frame ofreference. Particularly, the data processing circuitry 46 may employEquations (35)-(41) to perform steps 82 and 84, which are discussed ingreater detail below.

In the example illustrated in FIGS. 11-12, discussed above, themeasurements of the magnetic field {right arrow over (B)} were idealizedand without error. However, measurements taken in the field may containnoise or other errors. FIGS. 14-18 represent examples of the presentlydisclosed technique that simulate errors in measurement for a magneticdipole 28 rotating at a constant frequency. Particularly, FIGS. 14-16represent a first example, while FIGS. 17 and 18 represent a secondexample. In the example of FIGS. 14-16, as in the example of FIGS. 9-12,f=3 Hz, M=100 Amp-m², and the coordinates of the observation point 52are x=10 m, y=2 m, and z=10 m. However, because real data will be noisy,random numbers will be used to simulate noise with a standard deviationof 0.1 nanoTesla. The noise is added to magnetic field componentscalculated using Equations (13a), (13b), and (13c). Additionally, toindicate measured quantities, a tilde will be used in the followingequations. For example, {B_(x)(t_(i))}, {B_(y)(t_(i))}, and{B_(z)(t_(i))} refer to N measured signals obtained at times t_(i), i=0,. . . , N−1. The vector {right arrow over (r)} will be suppressed in thenotation for measured quantities. It should be noted that the objectiveis to determine the observation point ({right arrow over (r)}) withrespect to the rotating magnetic dipole located at (0,0,0). The threeunknown quantities are x, y, and z, while the four known quantities areM and the three-axis magnetometer 30 readings. Based on the followingdiscussion, the unknown quantities may be determined.

Turning to FIG. 14, a plot 86 represents simulated data obtained by themagnetometer 30 when f=3 Hz, M=100 Amp-m², and the coordinates of theobservation point 52 are x=10 m, y=2 m, and z=10 m. An ordinate 88represents a measurement of the magnetic field components of {rightarrow over (B)} in units of nanoTesla, and an abscissa 90 representstime in units of seconds. In the plot 86, a triangle represents a datapoint of a measurement of the x-component of the magnetic field,{B_(x)(t_(i))}, a diamond represents a data point of a measurement ofthe y-component of the magnetic field, {B_(y)(t_(i))}, and a circlerepresents a data point of a measurement of the z-component of themagnetic field, {B_(z)(t_(i))}. The magnetometer 30 is assumed to havetaken 100 measurements of each component per second.

For constant rotation, it may be more convenient to work with functionsthan raw data points. As such, FIG. 15 illustrates a plot 92 themeasured data of FIG. 14 that has been least squares fit to sinusoidalfunctions of the form: B_(j)(t)=A_(j) cos(ω_(j)t−P_(j)), where A_(j) isthe amplitude, P_(j) is the phase, and ω_(j) is the angular frequency,and where j=x, y, z. An ordinate 94 represents the magnetic fieldcomponents of {right arrow over (B)} in units of nanoTesla, and anabscissa 96 represents time in units of seconds. In the plot 92, atriangle represents a data point of a measurement of the x-component ofthe magnetic field, {B_(x)(t_(i))}, a diamond represents a data point ofa measurement of the y-component of the magnetic field, {B_(y)(t_(i))},and a circle represents a data point of a measurement of the z-componentof the magnetic field, {B_(z)(t_(i))}. Additionally, a dash-dotted linerepresents a least squares fit sinusoid to the x-component of themagnetic field, B x (t), a dashed line represents the least squares fitof a sinusoid to the y-component of the magnetic field, B_(y)(t), and asolid line represents the least squares fit of a sinusoid to thez-component of the magnetic field, B_(z)(t).

To obtain the least squares fitting of the measured magnetic field{right arrow over (B)} data, the frequency for each field component isallowed to float initially (since the rotation frequency may not beknown at the observation point 52). There are nine parameters to beobtained by minimizing the following quantities:

$\begin{matrix}{{\chi_{x}^{2} = {\sum\limits_{i}^{\;}\; \left\{ {{B_{x}\left( t_{i} \right)} - {A_{x}{\cos \left( {{\omega_{x}t_{i}} - P_{x}} \right)}}} \right\}^{2}}};} & \left( {27a} \right) \\{{{\chi_{y}^{2} = {\sum\limits_{i}^{\;}\; \left\{ {{B_{y}\left( t_{i} \right)} - {A_{y}{\cos \left( {{\omega_{y}t_{i}} - P_{y}} \right)}}} \right\}^{2}}};}{and}} & \left( {27b} \right) \\{\chi_{z}^{2} = {\sum\limits_{i}^{\;}\; {\left\{ {{B_{z}\left( t_{i} \right)} - {A_{z}{\cos \left( {{\omega_{z}t_{i}} - P_{z}} \right)}}} \right\}^{2}.}}} & \left( {27c} \right)\end{matrix}$

Once the nine parameters A_(x), A_(y), A_(z), P_(x), P_(y), P_(z),ω_(x), ω_(y), and ω_(z) are obtained from the three least squarescalculations, a further condition can be imposed:

ω=(ω_(x)+ω_(y)+ω_(z))/3  (28),

since the rotation rate must be the same for all magnetic fieldcomponents.

Using the average value for the angular frequency obtained from Equation(28), Equations (27a), (27b), and (27c) can be minimized a second timewith the constraint: ω_(x)=ω_(y)=ω_(z)= ω. The final values for A_(x),A_(y), A_(z), P_(x), P_(y), and P_(z) will be then used in subsequentcalculations rather than the raw measurements. For the plot 92 of FIG.15, the fitting parameters are A_(x)=1.91 nanoTesla, P_(x)=0.561radians, A_(y)=3.38 nanoTesla, P_(y)=−1.271 radians, A_(z)=5.14nanoTesla, and P_(z)=0.199 radians. As illustrated in FIG. 15, theagreement between raw data and the fitting functions is very good.

Using the fitted curves of the magnetic field {right arrow over (B)}measurements, an angle of rotation θ may be determined such that arotated x-component of the magnetic field, H_(x)(t), is in phase withthe z-component of the magnetic field B_(z)(t). From Equation (14), thefields in the rotated frame can be written as follows:

H _(x)(t)=A _(x) cos( ωt−P _(x))cos θ+A _(y) cos( ω t−P _(y))sinθ  (29a);

H _(y)(t)=−A _(x) cos( ω t−P _(x))sin θ+A _(y) cos( ω t−P _(y))cosθ  (29b); and

B _(z)(t)=A _(z) cos( ω t−P _(z))  (29c).

Equation (29a) can be re-arranged as follows:

H _(x)(t)=cos( ω t)[A _(x) cos P _(x) cos {tilde over (θ)}+A _(y) cos P_(y) sin {tilde over (θ)}]+sin( ω t)[A _(x) sin P _(x) cos {tilde over(θ)}+A _(y) sin P _(y) sin {tilde over (θ)}]  (30).

Equation (29c) can be similarly re-arranged as follows:

B _(z)(t)=cos( ω t)[A _(z) cos P _(z)]+sin( ω t)[A _(z) sin P_(z)]  (31).

Forcing the phase of H_(x)(t) to be the same as B_(z)(t) indicates thefollowing relationship:

$\begin{matrix}{\frac{\left\lbrack {A_{z}\sin \; P_{z}} \right\rbrack}{\left\lbrack {A_{z}\cos \; P_{z}} \right\rbrack} \equiv {\frac{\left\lbrack {{A_{x}\sin \; P_{x}\cos \; \theta} + {A_{y}\sin \; P_{y}\sin \; \theta}} \right\rbrack}{\left\lbrack {{A_{x}\cos \; P_{x}\cos \; \theta} + {A_{y}\cos \; P_{y}\sin \; \theta}} \right\rbrack}.}} & (32)\end{matrix}$

Re-arranging Equation (32) produces the following:

$\begin{matrix}{{\tan \; \overset{\sim}{\theta}} = {{- \frac{A_{x}}{A_{y}}}{\frac{\left\lbrack {{\cos \; P_{x}\tan \; P_{z}} - {\sin \; P_{x}}} \right\rbrack}{\left\lbrack {{\cos \; P_{y}\tan \; P_{z}} - {\sin \; P_{y}}} \right\rbrack}.}}} & (33)\end{matrix}$

The tilde over the determined rotation angle indicates that the valuefor the rotation angle is derived from measured data, i.e. from theparameters fit to the data. Equation (33) also provides the directionfrom the point of observation to the z-axis (i.e., toward the linedefined by (0,0,z)). Moreover, tan {tilde over (θ)}=tan γ=y/x, so oneunknown quantity (x or y) can be eliminated.

FIG. 16 illustrates a plot 98 of the rotated magnetic field data, whichmay be obtained by using Equation (33) to obtain {tilde over (θ)}=0.199radians and applying Equations (29a) and (29b). An ordinate 100represents the least squares fits of the magnetic field components inunits of nanoTesla, and an abscissa 102 represents time in units ofseconds. In the plot 98, a dashed line represents the rotatedx′-component of the magnetic field, H_(x)(t), a dotted line representsthe rotated y′-component of the magnetic field, H_(y)(t), and a solidline represents the z-component of the magnetic field, B_(z)(t). Therotated magnetic field component, H_(x)(t), is in-phase with B_(z)(t),while H_(y)(t) is π/2 radians out-of-phase with B_(z)(t).

Having determined the rotated frame of reference, the transformedmagnetic field data may be employed in the rotated frame by the dataprocessing circuitry 46 to determine the relative location of themagnetometer 30 to the magnetic dipole 28. To determine the relativelocation, the data processing circuitry 46 may employ the amplitudevalues of the rotated magnetic fields in conjunction with the angle ofrotation, as discussed below with reference to Equations (34)-(41). Asdiscussed above, in the rotated frame where tan θ=tan γ, the magneticfield components have the forms:

$\begin{matrix}{{{H_{x}\left( {\overset{\rightarrow}{r},t} \right)} = {\frac{3\mu_{0}M}{4\pi \; r^{5}}\left( {{\frac{2}{3}r^{2}} - z^{2}} \right){\cos \left( {{\omega \; t} - \theta} \right)}}};} & (24) \\{{{{H_{y}\left( {\overset{\rightarrow}{r},t} \right)} = {{- \frac{\mu_{0}M}{4\pi \; r^{3}}}{\sin \left( {{\omega \; t} - \theta} \right)}}};}{and}} & (25) \\{{B_{z}\left( {\overset{\rightarrow}{r},t} \right)} = {\frac{3\mu_{0}M}{4\pi \; r^{5}}z\sqrt{x^{2} + y^{2}}{{\cos \left( {{\omega \; t} - \theta} \right)}.}}} & \left( {13c} \right)\end{matrix}$

In the rotated frame that satisfies Equation (33), and except for noise,the three measured magnetic field components have the same form:

H _(x)(t)=H _(ox) cos( ω t−P _(z))  (34a);

H _(y)(t)=−H _(oy) sin( ω t−P _(z))  (34b); and

B _(z)(t)=A _(z) cos( ω t−P _(z))  (34c),

where H_(ox) and H_(oy) are constants.

The same phase P_(z) occurs in Equations (34a), (34b) and (34c). This issimply a restatement that the phase of H_(x)(t) is in the same as thephase of B_(z)(t) and that the phase of H_(y)(t) is π/2 radians out-ofphase with B_(z)(t). The amplitude H_(ox) is obtained by settingEquation (29a) equal to Equation (34a):

$\begin{matrix}{{H_{x}(t)} = {{{\cos \left( {\overset{\_}{\omega}t} \right)}\left\lbrack {{A_{x}\cos \; P_{x}\cos \; \overset{\sim}{\theta}} + {A_{y}\cos \; P_{y}\sin \overset{\sim}{\theta}}} \right\rbrack} +}} \\{{{\sin \left( {\overset{\_}{\omega}t} \right)}\left\lbrack {{A_{x}\sin \; P_{x}\cos \; \overset{\sim}{\theta}} + {A_{y}\sin \; P_{y}\sin \overset{\sim}{\theta}}} \right\rbrack}} \\{= {H_{ox}{\cos \left( {{\overset{\_}{\omega}t} - P_{z}} \right)}}} \\{{= {H_{ox}\left\lbrack {{\cos \; \overset{\_}{\omega}t\; \cos \; P_{z}} + {\sin \overset{\_}{\omega}t\; \sin \; P_{z}}} \right\rbrack}};}\end{matrix}$

hence:

$\begin{matrix}{H_{ox} = {\frac{\left\lbrack {{A_{x}\cos \; P_{x}\cos \overset{\sim}{\theta}} + {A_{y}\cos \; P_{y}\sin \; \overset{\sim}{\theta}}} \right\rbrack}{\cos \; P_{z}}.}} & (35)\end{matrix}$

Similarly, the amplitude H_(oy) is obtained by setting Equation (29b)equal to Equation (34b) as follows:

$\begin{matrix}{{{{H_{y}(t)} = {{{- A_{x}}{\cos \left( {{\overset{\_}{\omega}t} - P_{x}} \right)}\sin \; \overset{\sim}{\theta}} + {A_{y}{\cos \left( {{\overset{\_}{\omega}t} - P_{y}} \right)}\cos \overset{\sim}{\theta}}}};}\begin{matrix}{{H_{y}(t)} = {{{\cos \left( {\overset{\_}{\omega}t} \right)}\left\lbrack {{{- A_{x}}\cos \; P_{x}\sin \; \overset{\sim}{\theta}} + {A_{y}\cos \; P_{y}\cos \; \overset{\sim}{\theta}}} \right\rbrack} +}} \\{{{\sin \left( {\overset{\_}{\omega}t} \right)}\left\lbrack {{{- A_{x}}\sin \; P_{x}\sin \; \overset{\sim}{\theta}} + {A_{y}\sin \; P_{y}\cos \; \overset{\sim}{\theta}}} \right\rbrack}} \\{= {{- H_{oy}}{\sin \left( {{\overset{\_}{\omega}t} - P_{z}} \right)}}} \\{{= {- {H_{oy}\left\lbrack {{\sin \; \overset{\_}{\omega}t\; \cos \; P_{z}} - {\cos \; \overset{\_}{\omega}t\; \sin \; P_{z}}} \right\rbrack}}};}\end{matrix}{{hence},{H_{oy} = {\frac{\left\lbrack {{A_{x}\; \cos \; P_{x}\sin \; \overset{\sim}{\theta}} - {A_{y}\cos \; P_{y}\cos \; \overset{\sim}{\theta}}} \right\rbrack}{\sin \; P_{z}}.}}}} & (36)\end{matrix}$

Equations (34c), (35) and (36) define the amplitudes of the threemagnetic field components in the rotated frame in terms of theparameters obtained by least squares fitting the raw data to the cosinefunctions in Equations (27a), (27b), and (27c). Comparing Equations(24), (25), and (13c) to Equations (34a), (34b) and (34c) yields thefollowing:

$\begin{matrix}{{H_{ox} = {\frac{3\; \mu_{0}M}{4\; \pi \; r^{5}}\left( {{\frac{2}{3}r^{2}} - z^{2}} \right)}};} & \left( {37a} \right) \\{{H_{oy} = \frac{\mu_{0}M}{4\; \pi \; r^{3}}};{and}} & \left( {37b} \right) \\{A_{z} = {\frac{3\; \mu_{0}M}{4\; \pi \; r^{5}}z{\sqrt{x^{2} + y^{2}}.}}} & \left( {37c} \right)\end{matrix}$

Inverting Equation (37b) yields the estimated distance between themagnetometer 30 and the magnetic dipole 28:

$\begin{matrix}{{\overset{\sim}{r} = \sqrt[3]{\frac{\mu_{0}M}{4\; \pi {H_{oy}}}}},} & (38)\end{matrix}$

where the tilde indicates that {tilde over (r)} is obtained frominverting the measurements.

Equation (37a) may be recast as:

$\begin{matrix}{{{z^{2} = {{{\frac{2}{3}{\overset{\sim}{r}}^{2}} \pm {\frac{4\; \pi \; {\overset{\sim}{r}}^{5}}{3\; \mu_{0}M}{H_{ox}}}} = {{\overset{\sim}{r}}^{2}\left( {\frac{2}{3} \pm {\frac{1}{3}{\frac{H_{ox}}{H_{oy}}}}} \right)}}},{or}}{\overset{\sim}{z} = {{\pm \overset{\sim}{r}}\sqrt{\frac{2}{3}}{\sqrt{1 \pm {\frac{1}{2}{\frac{H_{ox}}{H_{oy}}}}}.}}}} & (39)\end{matrix}$

Note that the proper sign must be chosen inside and outside of thesquare root to produce a physically reasonable answer. Again, the tildeindicates that {tilde over (z)} is obtained from inverting measurements.Noting that:

√{square root over (x ² +y ²)}=x√{square root over (1+(tan {tilde over(θ)})²)},

Equation (37c) can be recast as follows:

$\begin{matrix}{{{A_{z} = {\frac{3\; \mu_{0}M}{4\; \pi \; {\overset{\sim}{r}}^{5}}\overset{\sim}{z}x\sqrt{1 + \left( {\tan \; \overset{\sim}{\theta}} \right)^{2}}}},{or}}{x = {{\pm \frac{{\overset{\sim}{r}}^{2}}{3\; \overset{\sim}{z}\sqrt{1 + \left( {\tan \; \overset{\sim}{\theta}} \right)^{2}}}}{{\frac{A_{z}}{H_{oy}}}.}}}} & (40)\end{matrix}$

Finally, the last unknown is determined from the following relationship:

y=x tan {tilde over (θ)}  (41).

FIGS. 17 and 18 illustrate an example similar to that of FIGS. 14-16 forusing the presently disclosed technique. As in the example of FIGS.14-16 above, FIGS. 17 and 18 simulate slight errors in measurement for amagnetic dipole 28 rotating at a constant frequency. In the example ofFIGS. 17 and 18, f=3Hz, M=100 Amp-m², and the coordinates of theobservation point 52 are x=10 m, y=2 m, and z=−10 m. However, becausereal data will be noisy, random numbers will be used to simulate noisewith a standard deviation of 0.1 nanoTesla. The noise is added tomagnetic field components calculated using Equations (13a), (13b), and(13c). Additionally, to indicate measured quantities, a tilde will beused in the following equations. For example, {B_(x)(t_(i))},{B_(y)(t_(i))}, and {B_(z)(t_(i))} refer to N measured signals obtainedat times i=0, . . . , N−1. The vector {right arrow over (r)} will besuppressed in the notation for measured quantities. It should be notedthat the objective is to determine the observation point ({right arrowover (r)}) with respect to the rotating magnetic dipole located at(0,0,0). The three unknown quantities are x, y, and z, while the fourknown quantities are M and the three-axis magnetometer 30 readings.Based on the following discussion, the unknown quantities may bedetermined.

Turning to FIG. 17, a plot 104 represents simulated data obtained by themagnetometer 30 when f=3 Hz, M=100 Amp-m², and the coordinates of theobservation point 52 are x=10 m, y=2 m, and z=−10 m. An ordinate 106represents a measurement of the magnetic field components of {rightarrow over (B)} in units of nanoTesla, and an abscissa 108 representstime in units of seconds. In the plot 104, a triangle represents a datapoint of a measurement of the x-component of the magnetic field,{B_(x)(t_(i))}, a diamond represents a data point of a measurement ofthe y-component of the magnetic field, {B_(y)(t_(i))}, and a circlerepresents a data point of a measurement of the z-component of themagnetic field, {B_(z)(t_(i))}. The magnetometer 30 is assumed to havesimultaneously sampled each magnetic field component every 0.01 secondsfor a total measurement time of one second.

FIG. 18 illustrates a plot 110 of the measured data of FIG. 17 that hasbeen least squares fit to sinusoids. An ordinate 110 represents a leastsquares fitting of the magnetic field components of {right arrow over(B)} in units of nanoTesla, and an abscissa 114 represents time in unitsof seconds. In the plot 110, a triangle represents a data point of ameasurement of the x-component of the magnetic field, {B_(x)(t_(i))}, adiamond represents a data point of a measurement of the y-component ofthe magnetic field, {B_(y)(t_(i))}, and a circle represents a data pointof a measurement of the z-component of the magnetic field,{B_(z)(t_(i))}.

The least squares fitting of FIG. 18 may be determined in two steps. Afirst least squares fitting may employ Equations (27a), (27b), and (27c)to obtain A_(x), A_(y), A_(z), P_(x), P_(y), P_(z). ω_(x), ω_(y), andω_(z). As such, the angular frequencies are ω_(x)=18.83 radian/sec,ω_(y)=18.87 radian/sec, ω_(z)=18.86 radian/sec, and ω=18.85 radian/sec.A second least squares fitting may employ Equations (27a), (27b), and(27c) using ω_(x)=ω_(y)=ω_(z)= ω=18.85 radian/sec. The fit parametersare thus A_(x)=1.55 nanoTesla, P_(x)=3.013 radians, A_(y)=1.99nanoTesla, P_(y)=−1.451 radians, A_(z)=1.88 nanoTesla, and P_(z)=3.538radians. The resulting functions, A_(x) cos( ωt−P_(x)), A_(y) cos(ωt−P_(y)), and A_(z) cos( ωt−P_(z)), are illustrated as a dash-dottedline, a dashed line, and a solid line, respectively, in the plot 110 ofFIG. 18.

Based on the least squares fitting of FIG. 18, the relative location ofthe magnetometer 30 to the magnetic dipole 28 may be determined.Equation (33) may be used to compute the angle {tilde over (θ)}, whichgives the direction from the observation point to the z-axis, and wheretan {tilde over (θ)}=y/x can be used to eliminate one unknown quantity.The results are thus tan θ=0.407 and θ=0.386 radians. Next, Equations(35) and (36) may be used to obtain H_(ox)=1.45 nanoTesla, andH_(oy)=2.07 nanoTesla, and Equation (38) yields {tilde over (r)}=16.90 mwith an error Δr={tilde over (r)}−r=0.02 m, where the “true” value for rwas obtained from the initial conditions in the calculation. Finally,Equation (39) yields {tilde over (r)}=−16.03 m with an error Δz={tildeover (z)}−z=−0.03 m, Equation (40) yields x=4.99 m with an errorΔx=x−x=−0.01 m, and Equation (41) yields y=2.03 m with an errorΔy=y−y=0.03 m.

FIG. 19 is a flowchart 116, which describes a general manner of drillinga new well, such as the injector well 12, proximate to an existing well,such as the producer well 14. The flowchart 116 generally recounts thetechniques described above, for use when the magnetometer 30 in theproducer well 14 takes measurements when the magnetic dipole 28 isrotating at a constant frequency in the injector well 12.

In a first step 118, the three magnetic field {right arrow over (B)}components from the rotating magnetic dipole 28 may be measured by themagnetometer 30 for a predetermined period of time (e.g., one second orone or more periods of rotation of the magnetic dipole 28). Suchmeasurements may be denoted as {B_(x)(t_(i))}, {B_(y)(t_(i))}, and{B_(z)(t_(i))} for i=0, 2, 3, . . . , N−1. The magnetic field componentsare represented in the (x,y,z) coordinate system defined by the magneticdipole 28, in which the magnetic dipole 28 rotates around the z-axis inthe plane of the x and y axes. The raw magnetometer 30 readings may bereceived by the data acquisition circuitry 42 before being stored in thedatabase 44 or transmitted to the data processing circuitry 46.Particular examples of simulated magnetometer 30 readings are discussedabove with reference to FIGS. 14 and 17.

In steps 120-124, the raw data collected in step 118 may be leastsquares fitted to sinusoidal curves. As such, in step 120, the dataprocessing circuitry may minimize the quantities;

${\chi_{x}^{2} = {\sum\limits_{i}\left\{ {{B_{x}\left( t_{i} \right)} - {A_{x}{\cos \left( {{\omega_{x}t_{i}} - P_{x}} \right)}}} \right\}^{2}}},{\chi_{y}^{2} = {\sum\limits_{i}\left\{ {{B_{y}\left( t_{i} \right)} - {A_{y}{\cos \left( {{\omega_{y}t_{i}} - P_{y}} \right)}}} \right\}^{2}}},{and}$${\chi_{z}^{2} = {\sum\limits_{i}\left\{ {{B_{z}\left( t_{i} \right)} - {A_{z}{\cos \left( {{\omega_{z}t_{i}} - P_{z}} \right)}}} \right\}^{2}}},$

where i=0, 2, 3, . . . , N−1 with respect to A_(x), A_(y), A_(z), P_(x),P_(y), P_(z), ω_(x), ω_(y), and ω_(z). In step 122, the data processingcircuitry 46 may compute an average angular frequency according to theequation ω=(ω_(x)+ω_(y)+ω_(z))/3. In step 124, the data processingcircuitry may next minimize the quantities

${\chi_{x}^{2} = {\sum\limits_{i}\left\{ {{B_{x}\left( t_{i} \right)} - {A_{x}{\cos \left( {{\overset{\_}{\omega}t_{i}} - P_{x}} \right)}}} \right\}^{2}}},{\chi_{y}^{2} = {\sum\limits_{i}\left\{ {{B_{y}\left( t_{i} \right)} - {A_{y}{\cos \left( {{\overset{\_}{\omega}t_{i}} - P_{y}} \right)}}} \right\}^{2}}},{and}$${\chi_{z}^{2} = {\sum\limits_{i}\left\{ {{B_{z}\left( t_{i} \right)} - {A_{z}{\cos \left( {{\overset{\_}{\omega}t_{i}} - P_{z}} \right)}}} \right\}^{2}}},$

with respect to A_(x), A_(y), A_(z), P_(x), P_(y), and P_(z). Particularexamples of the least squares fitting of step 124 are discussed abovewith reference to FIGS. 15 and 18.

The rotated frame of reference may be determined in steps 126 and 128.In step 126, the data processing circuitry 46 may calculate the rotationangle using the relationship

${\tan \; \overset{\sim}{\theta}} = {{- \frac{A_{x}}{A_{y}}}{\frac{\left\lbrack {{\cos \; P_{x}\; \tan \; P_{z}} - {\sin \; P_{x}}} \right\rbrack}{\left\lbrack {{\cos \; P_{y}\; \tan \; P_{z}} - {\sin \; P_{y}}} \right\rbrack}.}}$

In step 128, the data processing circuitry may obtain the direction yfrom the z-axis of the magnetic dipole toward the magnetometer fromγ=θ+n·π, where n=0,1.

In steps 130-138, the data processing circuitry 46 may determine therelative location of the magnetometer 30 to the rotating magnetic dipole28. In step 130, the data processing circuitry 46 may calculate themagnetic field amplitudes

$H_{ox} = {\frac{\left\lbrack {{A_{x}\; \cos \; P_{x}\cos \; \overset{\sim}{\theta}} + {A_{y}\; \cos \; P_{y}\; \sin \; \overset{\sim}{\theta}}} \right\rbrack}{\cos \; P_{z}}\mspace{14mu} {and}}$$H_{oy} = {\frac{\left\lbrack {{A_{x}\; \cos \; P_{x}\sin \; \overset{\sim}{\theta}} + {A_{y}\; \cos \; P_{y}\; \cos \; \overset{\sim}{\theta}}} \right\rbrack}{\cos \; P_{z}}.}$

Based on the calculation of step 130, in step 132, the data processingcircuitry 46 may next calculate the distance between the magnetic dipoleand the magnetometer with

$\overset{\sim}{r} = {\sqrt[3]{\frac{\mu_{0}M}{4\; \pi {H_{oy}}}}.}$

In step 134, the data processing circuitry 46 may calculate themagnetometer's z position with

${\overset{\sim}{z} = {{\pm \overset{\sim}{r}}\sqrt{\frac{2}{3}}\sqrt{1 \pm {\frac{1}{2}{\frac{H_{ox}}{H_{oy}}}}}}},$

and in step 136, the data processing circuitry 46 may calculate themagnetometer's x position with

$x = {{\pm \frac{{\overset{\sim}{r}}^{2}}{3\; \overset{\sim}{z}\sqrt{1 + \left( {\tan \; \overset{\sim}{\theta}} \right)^{2}}}}{{\frac{A_{z}}{H_{oy}}}.}}$

The data processing circuitry 46 may finally calculate themagnetometer's y position with y=x tan {tilde over (θ)} in step 138.

Based on the above steps 134-138, in step 140, the data processingcircuitry 46 may output a relative location report 48 indicating therelative location of the magnetometer 30 to the magnetic dipole 28.Thus, the position of the magnetic dipole 28 in a coordinate systemattached to the magnetometer is (−x,−y,−{tilde over (z)}). Theinformation provided by the report 48 may be employed to steer the BHA18 to drill a desired configuration. For example, the BHA 18 may besteered by the BHA control/MWD interface 50 such that the BHA 18 drillsat an approximately constant distance (e.g., 4-6 m) above an existingwell containing the magnetometer 30, which may create a SAGD well pairas illustrated in the well-drilling operation 10 of FIG. 1.

FIGS. 20A-C illustrate the amount of error associated with the abovetechniques when the magnetometer 30 is located at various distances fromthe magnetic dipole 28 along the z-axis. In FIGS. 20A-C, measurementsare simulated as being taken along the line defined by x=5 m and y=2 m,with data points every 2 meters along the z direction at the points:z=−30, −28, −26, . . . , +28, +30 m. In this simulation, the coordinatesof the observation point 52 are changing, while the magnetic dipolesource remains at the origin. At the point z=0 m, the magnetometer 30 isdirectly below the magnetic dipole 28 in the (x,y,z) coordinate system.FIGS. 20A-C simulate what may occur when drilling the injector well 12,which contains the rotating magnetic dipole 28, while measuring themagnetic field {right arrow over (B)} using the magnetometer 30 in theproducer well 14 at a fixed location. Each data point in FIGS. 20A-Ccorresponds to a solution of the position of the magnetometer 30 usingdata from a single relative location to the magnetic dipole 28. Theinferred position (x,y,{tilde over (z)}) of the magnetometer 30 relativeto the magnetic dipole 28 can be compared to the “true” position (x,y,z)used to initially simulate the magnetic field {right arrow over (B)}. Inpractice, the desired quantity is the inferred position of the magneticdipole relative to the magnetometer 30. This is given simply by(−x,−y,−{tilde over (z)}) in the coordinate system centered on themagnetometer 30. Hence, the information from the known position of themagnetometer 30 and the measured magnetic field {right arrow over (B)}components can be used to steer the drill bit 20 in the injector well12.

FIG. 20A represents a plot 142 of an error Δx=x−x, which indicates thedifference between the value in the x-direction calculated according tothe above-described techniques and the actual value of the x-direction,at various points in the z-direction. An ordinate 144 represents theerror Δx=x−x in units of meters, while an abscissa 146 represents pointsin the z-direction in units of meters at which the magnetometer 30obtained (simulated) measurements. As illustrated in the plot 142, theerrors are less than 0.5 m over the range of z=−20 m to z=+20 m, andgenerally less than 1 m over the range of z=−30 m to z=+30 m. Note thatthere is no calculation possible at z=0 m since B_(z)(t)=0 at thislocation.

FIG. 20B similarly represents a plot 148 of an error Δy=y−y, whichindicates the difference between the value in the y-direction calculatedaccording to the above-described techniques and the actual value of they-direction, at various points in the z-direction. An ordinate 148represents the error Δy=y−y in units of meters, while an abscissa 152represents points in the z-direction in units of meters at which themagnetometer 30 obtained (simulated) measurements. As illustrated in theplot 148, the errors are less than 0.5 m over the range of z=−20 m toz=+20 m, and generally less than 1 m over the range of z=−30 m to z=+30m.

FIG. 20C similarly represents a plot 154 of an error Δz={tilde over(z)}−z, which indicates the difference between the value in thez-direction calculated according to the above-described techniques andthe actual value in the z-direction, at various points in thez-direction. An ordinate 156 represents the error Δz={tilde over (z)}−zin units of meters, while an abscissa 158 represents points in thez-direction in units of meters at which the magnetometer 30 obtained(simulated) measurements. As illustrated in the plot 154, the errors areless than 0.5 m over the range of z=−20 m to z=+20 m, and generally lessthan 1 m over the range of z=−30 m to z=+30 m.

In the discussion above, the rotation of the magnetic dipole 28 in theBHA 18 has been assumed to be constant. However, the BHA 18 may not havea constant rotation frequency. Indeed, stick-slip and other drillingdynamics may cause the frequency to vary during a measurement cycle.Variations in frequency may be accommodated by modifying the previousformulas slightly. For example, the instantaneous frequency may increaseor decrease during the measurement period as a chirp according to thefollowing relationship:

f(t)=f ₀ +f ₁ t  (42),

where f₀, and f₁ are constants.

This type of variation is not unrealistic as the BHA rotation can beaccelerating or decelerating. The angular frequency term becomes

ω(t)=ω₀+ω₁ t=2π(f ₀ +f ₁ t)  (43).

The measurements can be least squares fit to based on equations similarto Equation (27a):

$\begin{matrix}{{\chi_{x}^{2} = {\sum\limits_{i}\left\{ {{B_{x}\left( t_{i} \right)} - {A_{x}{\cos \left( {{{\omega_{x}\left( t_{i} \right)}t_{i}} - P_{x}} \right)}}} \right\}^{2}}};} & \left( {44a} \right) \\{{\chi_{y}^{2} = {\sum\limits_{i}\left\{ {{B_{y}\left( t_{i} \right)} - {A_{y}{\cos \left( {{{\omega_{y}\left( t_{i} \right)}t_{i}} - P_{y}} \right)}}} \right\}^{2}}};{and}} & \left( {44b} \right) \\{{\chi_{z}^{2} = {\sum\limits_{i}\left\{ {{B_{z}\left( t_{i} \right)} - {A_{z}{\cos \left( {{{\omega_{z}\left( t_{i} \right)}t_{i}} - P_{z}} \right)}}} \right\}^{2}}},} & \left( {44c} \right)\end{matrix}$

except that ω_(j)(t)=2π(f_(0j)+f_(1j)t) for j=x, y, z are functions oftime; the fitting parameters are: A_(x), P_(x), f_(0x), f_(1x), A_(y),P_(y), f_(0y) f_(1y), A_(z), P_(z), f_(0z), and f_(1z).

FIG. 21 illustrates a flowchart 160, which describes a general manner ofdrilling a new well, such as the injector well 12, proximate to anexisting well, such as the producer well 14. The flowchart 160 generallyrecounts the techniques described above, as modified for use when themagnetometer 30 in the producer well 14 takes measurements when themagnetic dipole 28 is rotating at an increasing or decreasing frequencyin the injector well 12, rather than when the magnetic dipole 28 isrotating at a constant frequency.

In a first step 162, the three magnetic field {right arrow over (B)}components from the rotating magnetic dipole 28 may be measured by themagnetometer 30 for a predetermined period of time (e.g., two seconds orone or more periods of rotation of the magnetic dipole 28). Suchmeasurements may be denoted as {B_(x)(t_(i))}, {B_(y)(t_(i))}, and{B_(z)(t_(i))} for i=0, 2, 3, . . . , N−1. The magnetic field componentsare represented in the (x,y,z) coordinate system defined by the magneticdipole 28, in which the magnetic dipole 28 rotates around the z-axis inthe plane of the x and y axes. The raw magnetometer 30 readings may bereceived by the data acquisition circuitry 42 before being stored in thedatabase 44 or transmitted to the data processing circuitry 46.

In steps 164-168, the raw data collected in step 162 may be leastsquares fitted to sinusoidal curves. As such, in step 164, the dataprocessing circuitry may minimize the quantities

${\chi_{x}^{2} = {\sum\limits_{i}\left\{ {{B_{x}\left( t_{i} \right)} - {A_{x}{\cos \left( {{2\; {\pi \left( {f_{0\; x} + {f_{1\; x}t_{i}}} \right)}t_{i}} - P_{x}} \right)}}} \right\}^{2}}},{\chi_{y}^{2} = {\sum\limits_{i}\left\{ {{B_{y}\left( t_{i} \right)} - {A_{y}{\cos \left( {{2\; {\pi \left( {f_{0\; y} + {f_{1\; y}t_{i}}} \right)}t_{i}} - P_{y}} \right)}}} \right\}^{2}}},{and}$${\chi_{z}^{2} = {\sum\limits_{i}\left\{ {{B_{z}\left( t_{i} \right)} - {A_{z}{\cos \left( {{2\; {\pi \left( {f_{0\; z} + {f_{1\; z}t_{i}}} \right)}t_{i}} - P_{z}} \right)}}} \right\}^{2}}},$

where i=0, 2, 3, . . . , N−1, with respect to A_(x), A_(y), A_(z),P_(x), P_(y), P_(z), f_(0x), f_(1x), f_(0y), f_(1y), f_(0z), and f_(1z).In step 166, the data processing circuitry 46 may compute an averageangular frequency according to the equations f₀=(f_(0x)+f_(0y)+f_(0z))/3 and f ₁=(f_(1x)+f_(1y)+f_(1z))/3. In step168, the data processing circuitry may next minimize the quantities

${\chi_{x}^{2} = {\sum\limits_{i}\left\{ {{B_{x}\left( t_{i} \right)} - {A_{x}{\cos \left( {{2\; {\pi \left( {{\overset{\_}{f}}_{0\;} + {{\overset{\_}{f}}_{1}t_{i}}} \right)}t_{i}} - P_{x}} \right)}}} \right\}^{2}}},{\chi_{y}^{2} = {\sum\limits_{i}\left\{ {{B_{y}\left( t_{i} \right)} - {A_{y}{\cos \left( {{2\; {\pi \left( {{\overset{\_}{f}}_{0\;} + {{\overset{\_}{f}}_{1}t_{i}}} \right)}t_{i}} - P_{y}} \right)}}} \right\}^{2}}},{and}$${\chi_{z}^{2} = {\sum\limits_{i}\left\{ {{B_{z}\left( t_{i} \right)} - {A_{z}{\cos \left( {{2\; {\pi \left( {{\overset{\_}{f}}_{0} + {{\overset{\_}{f}}_{1}t_{i}}} \right)}t_{i}} - P_{z}} \right)}}} \right\}^{2}}},$

with respect to A_(x), A_(y), A_(z), P_(x), P_(y), and P_(z). Aparticular example of the least squares fitting of step 168 is discussedbelow with reference to FIG. 22.

The rotated frame of reference may be determined in steps 170 and 172.In step 170, the data processing circuitry 46 may calculate the rotationangle using the relationship

${\tan \; \overset{\sim}{\theta}} = {{- \frac{A_{x}}{A_{y}}}{\frac{\left\lbrack {{\cos \; P_{x}\; \tan \; P_{z}} - {\sin \; P_{x}}} \right\rbrack}{\left\lbrack {{\cos \; P_{y}\; \tan \; P_{z}} - {\sin \; P_{y}}} \right\rbrack}.}}$

In step 172, the data processing circuitry may obtain the direction γfrom the z-axis of the magnetic dipole toward the magnetometer fromγ=θ+n·π, where n=0,1.

In steps 174-182, the data processing circuitry 46 may determine therelative location of the magnetometer 30 to the rotating magnetic dipole28. In step 174, the data processing circuitry 46 may calculate themagnetic field amplitudes

$H_{ox} = {\frac{\left\lbrack {{A_{x}\cos \; P_{x\;}\cos \; \overset{\sim}{\theta}} + {A_{y}\cos \; P_{y}\sin \; \overset{\sim}{\theta}}} \right\rbrack}{\cos \; P_{z}}\mspace{14mu} {and}}$$H_{oy} = {\frac{\left\lbrack {{A_{x}\cos \; P_{x}\sin \; \overset{\sim}{\theta}} - {A_{y}\cos \; P_{y}\; \cos \; \overset{\sim}{\theta}}} \right\rbrack}{\sin \; P_{z}}.}$

Based on the calculation of step 174, in step 176, the data processingcircuitry 46 may next calculate the distance between the magnetic dipoleand the magnetometer with

$\overset{\sim}{r} = {\sqrt[3]{\frac{\mu_{0}M}{4\pi {H_{oy}}}}.}$

In step 178, the data processing circuitry 46 may calculate themagnetometer's z position with

${\overset{\sim}{z} = {{\pm \overset{\sim}{r}}\sqrt{\frac{2}{3}}\sqrt{1 \pm {\frac{1}{2}{\frac{H_{ox}}{H_{oy}}}}}}},$

and in step 180, the data processing circuitry 46 may calculate themagnetometer's x position with

$x = {{\pm \frac{{\overset{\sim}{r}}^{2}}{3\overset{\sim}{z}\sqrt{1 + \left( {\tan \; \overset{\sim}{\theta}} \right)^{2}}}}{{\frac{A_{z}}{H_{oy}}}.}}$

The data processing circuitry 46 may finally calculate themagnetometer's y position with y=x tan {tilde over (θ)} in step 182.

Based on the above steps 174-182, in step 184, the data processingcircuitry 46 may output a relative location report 48 indicating therelative location of the magnetometer 30 to the magnetic dipole 28.Thus, the position of the magnetic dipole 28 in a coordinate systemattached to the magnetometer is (−x,−y,−{tilde over (z)}). Theinformation provided by the report 48 may be employed to steer the BHA18 to drill a desired configuration. For example, the BHA 18 may besteered by the BHA control/MWD interface 50 such that the BHA 18 drillsat an approximately constant distance (e.g., 4-6 m) above an existingwell containing the magnetometer 30, which may create a SAGD well pairas illustrated in the well-drilling operation 10 of FIG. 1.

FIG. 22 provides a plot 186 of simulated measurements for a magneticdipole 28 rotating at an increasing or decreasing frequency. In theexample of FIG. 22, M=100 Amp-m², and the coordinates of the observationpoint 52 are x=5 m, y=2 m, and z=−14 m, with f₀=2 Hz and f₁=0.5 Hz/sec.As such, the instantaneous frequency is 2 Hz at the beginning of themeasurement and 3 Hz at the end of the measurement. Because real datawill be noisy, random numbers will be used to simulate noise with astandard deviation of 0.1 nanoTesla. The noise is added to magneticfield components calculated using Equations (13a), (13b), and (13c) and,as in the examples described above, a tilde will be used in thefollowing equations to indicate measured quantities. For example,{B_(x)(t_(i))}, {B_(y)(t_(i))}, and {B_(z)(t_(i))} refer to N measuredsignals obtained at times t_(i), i=0, . . . , N−1. The vector {rightarrow over (r)} will be suppressed in the notation for measuredquantities. It should be noted that the objective is to determine theobservation point ({right arrow over (r)}) with respect to the rotatingmagnetic dipole located at (0,0,0). The three unknown quantities are x,y, and z, while the four known quantities are M and the three-axismagnetometer 30 readings.

In FIG. 22, the plot 186 represents simulated data obtained by themagnetometer 30 that has been least squares fit to sinusoids. Anordinate 188 represents a least squares fitting of the magnetic fieldcomponents of {right arrow over (B)} in units of nanoTesla, and anabscissa 190 represents time in units of seconds. In the plot 186, atriangle represents a data point of a measurement of the x-component ofthe magnetic field, {B_(x)(t_(i))}, a diamond represents a data point ofa measurement of the y-component of the magnetic field, {B_(y)(t_(i))},and a circle represents a data point of a measurement of the z-componentof the magnetic field, {B_(z)(t_(i))}. The three field components aresimulated as sampled 100 times with a time interval of 0.02 seconds, fora total measurement time of 2 seconds.

The least squares fitting of FIG. 22 may be determined in two steps. Afirst least squares fitting may employ Equations (44a), (44b), and (44c)to obtain A_(x), A_(y), A_(z), P_(x), P_(y), P_(z), f_(x0), f_(x1),f_(y0), f_(y1), f_(z0), and f_(z1). Next, the frequencies may beaveraged to provide the results f ₀=(f_(0x)+f_(0y)+f_(0z))/3=1.99 Hz andf ₁=(f_(1x)+f_(1y)+f_(1z))/3=0.5004 Hz/sec. A second least squaresfitting may employ Equations (44a), (44b), and (44c) with all threemagnetic field components forced to have the same time dependence with f₀ and f ₁. The parameters, A_(x), A_(y), A_(z), P_(x), P_(y), and P_(z)may be allowed to float in minimizing χ_(x) ², χ_(y) ², and χ_(z) ². Theresulting functions A_(x) cos(2π( f ₀+ f ₁t)t−P_(x)), A_(y) cos(2π( f ₀+f ₁t)t−P_(y)), and A_(z) cos(2π( f ₀+ f ₁t)t−P_(z)) may be fit to thedata {B_(x)(t_(i))}, {B_(y)(t_(i))} and {B_(z)(t_(i))}, and appear as adash-dotted line, a dashed line, and a solid line, respectively, in theplot 186 of FIG. 22.

Based on the least squares fitting of FIG. 22, the relative location ofthe magnetometer 30 to the magnetic dipole 28 may be determined.Equation (33) may be used to compute the angle {tilde over (θ)}, whichgives the direction from the observation point to the z-axis, and wheretan {tilde over (θ)}=y/x can be used to eliminate one unknown quantity.The results are thus tan {tilde over (θ)}=0.395 and {tilde over(θ)}=0.376 radians. Next, Equations (35) and (36) may respectively beused to obtain H_(ox)=1.81 nanoTesla and H_(oy)=3.01 nanoTesla, andyields {tilde over (r)}=14.93 m with an error Δr={tilde over(r)}−r=−0.07 m. Finally, Equation (39) yields {tilde over (z)}=−13.90 mwith an error Δz={tilde over (z)}−z=0.10 m, Equation (40) yields x=4.91m with an error Δx=x−x=−0.09 m, and Equation (41) yields y=1.94 m withan error Δy=y−y=−0.06 m.

FIGS. 23A-C illustrate the error of the above-described techniques usedwhen the magnetic dipole 28 is rotating at an increasing or decreasingfrequency for a series of (simulated) magnetometer 30 readings atvarious distances from the magnetic dipole 28 in the z-direction. InFIGS. 23A-C, measurements are simulated as being taken along the linedefined by x=5 m and y=2 m, with data points every 2 meters along the zdirection at the points: z=−30, −28, −26, . . . , +28, +30 m. At thepoint z=0 m, the magnetometer 30 is directly below the magnetic dipole28 in the (x, y, z) coordinate system. FIGS. 23A-C simulate what mayoccur when drilling the injector well 12, which contains the rotatingmagnetic dipole 28, while measuring the magnetic field {right arrow over(B)} using the magnetometer 30 in the producer well 14 at various fixedlocations. Each data point in FIGS. 23A-C corresponds to a solution ofthe position of the magnetometer 30 using data from a single relativelocation to the magnetic dipole 28. The inferred position (x,y,{tildeover (z)}) of the magnetometer 30 relative to the magnetic dipole 28 canbe compared to the “true” position (x,y,z) used to initially simulatethe magnetic field {right arrow over (B)}.

FIG. 23A represents a plot 194 of an error Δx=x−x, which indicates thedifference between the value in the x-direction calculated according tothe techniques described with reference to the flowchart 160 of FIG. 21,and the actual value of the x-direction, determined at various points inthe z direction. An ordinate 196 represents the error Δx=x−x in units ofmeters, while an abscissa 198 represents points in the z-direction inunits of meters at which the magnetometer 30 obtained (simulated)measurements. As illustrated in the plot 194, the errors are less than0.5 m over the range of z=−20 m to z=+20 m, and generally less than 1 mover the range of z=−30 m to z=+30 m. Note that there is no calculationpossible at z=0 m since B_(z)(t)=0 at this location.

FIG. 23B similarly represents a plot 200 of an error Δy=y−y, whichindicates the difference between the value in the y-direction calculatedaccording to the techniques described with reference to the flowchart160 of FIG. 21, and the actual value of the y-direction, determined atvarious points in the z direction. An ordinate 202 represents the errorΔy=y−y in units of meters, while an abscissa 204 represents points inthe z-direction in units of meters at which the magnetometer 30 obtained(simulated) measurements. As illustrated in the plot 200, the errors areless than 0.5 m over the range of z=−20 m to z=+20 m, and generally lessthan 1 m over the range of z=−30 m to z=+30 m.

FIG. 23C similarly represents a plot 206 of an error Δz={tilde over(z)}−z, which indicates the difference between the value in thez-direction calculated according to the techniques described withreference to the flowchart 160 of FIG. 21, and the actual value of thez-direction, determined at various points in the z direction. Anordinate 208 represents the error Δz={tilde over (z)}−z in units ofmeters, while an abscissa 210 represents points in the z-direction inunits of meters at which the magnetometer 30 obtained (simulated)measurements. As illustrated in the plot 148, the errors are less than0.5 m over the range of z=−20 m to z=+20 m, and generally less than 1 mover the range of z=−30 m to z=+30 m.

FIG. 24 provides a plot 212 comparing variations in frequency simulatedin the data obtained relating to the plots 194, 200, and 206 of FIGS.23A-C, respectively. In the plot 212, a first ordinate 214 represents arange of the frequency of rotation of the magnetic dipole 28 in units ofHertz, a second ordinate 216 represents the variation in the frequencyof rotation of the magnetic dipole 28 that occurred in each magnetometer30 reading, and an abscissa 218 represents points in the z-direction inunits of meters at which the magnetometer 30 obtained (simulated)measurements. As illustrated in the plot 212 and in view of the plots194, 200, and 206 of FIGS. 23A-C, variations in frequency may reachbeyond ±40% and the least squares process may successfully determine therelative location of the magnetometer 30 to the magnetic dipole 28.

The method of the flowchart 160 of FIG. 21 may be modified to include asecond order term. The second order term, f₂, may be incorporated in thedefinition of the frequency of rotation of the magnetic dipole 28 asfollows:

f(t)=f ₀ +f ₁ t+f ₂ t ²  (45).

The method of the flowchart 160 may be otherwise unchanged. However,including such higher order terms may particularly benefit from a goodsignal to noise ratio.

Under certain circumstances, the rotation of the magnetic dipole 28 maybe arbitrary. A more general approach is possible where the measuredmagnetic field components, {B_(x)(t_(i))}, {B_(y)(t_(i))}, and{B_(z)(t_(i))}, are used directly without fitting them to sinusoidal orother functions. Note that the three magnetic field components aremeasured at the same times {t_(i)} for i=0, 2, 3, . . . , N−1. A moregeneral approach may not make assumptions about the time dependenceother than that the magnetic dipole rotates and data are obtained overat least one rotation. From Equation (14), the magnetic field in therotated frame can be written as follows:

H _(x)(t)=cos θB _(x)(t)+sin θB _(y)(t)  (46).

The angle of rotation θ should be chosen such that {H_(x)(t_(i))} is inphase with {B_(z)(t_(i))}. The angle θ may be determined by minimizingthe following quantity with respect to the parameters θ and C asfollows:

$\begin{matrix}\begin{matrix}{\chi^{2} = {\sum\limits_{i}\left\{ {{{CH}_{x}\left( t_{i} \right)} - {B_{z}\left( t_{i} \right)}} \right\}^{2}}} \\{= {\sum\limits_{i}{\left\{ {{C\left\lbrack {{\cos \; \theta \; {B_{x\;}\left( t_{i} \right)}} + {\sin \; \theta \; {B_{y}\left( t_{i} \right)}}} \right\rbrack} - {B_{z}\left( t_{i} \right)}} \right\}^{2}.}}}\end{matrix} & (47)\end{matrix}$

The scaling factor, C, from least squares fitting Equation (47) relates{H_(x)(t_(i))} to {B_(z)(t_(i))} in an average sense via the followingrelationship:

$\begin{matrix}{\frac{H_{x}(t)}{B_{z}(t)} = {\frac{1}{C}.}} & (48)\end{matrix}$

Hence, the angle of rotation {tilde over (θ)} and C may be obtained fromthe three magnetic field components. The two transverse magnetic fieldcomponents in the rotated frame may be determined as follows:

$\begin{matrix}{\begin{bmatrix}{H_{x}\left( t_{i} \right)} \\{H_{y}\left( t_{i} \right)}\end{bmatrix} = {{\begin{bmatrix}{\cos \; \overset{\sim}{\theta}} & {\sin \; \overset{\sim}{\theta}} \\{{- \sin}\; \overset{\sim}{\theta}} & {\cos \; \overset{\sim}{\theta}}\end{bmatrix}\begin{bmatrix}{B_{x}\left( t_{i} \right)} \\{B_{y}\left( t_{i\;} \right)}\end{bmatrix}}.}} & (49)\end{matrix}$

FIGS. 25-28 illustrate an example in which the magnetic dipole 28 mayrotate arbitrarily. In the example of FIGS. 25-28, the magnetic dipolestrength is M=100 Amp-m², the simulated noise is 0.1 nanoTesla, x=5 m,y=2 m, and z=12 m, and 100 samples are simulated over a 2 secondmeasurement period. To indicate measured quantities, a tilde will beused in the following equations. For example, {B_(x)(t_(i))},{B_(y)(t_(i))}, and {B_(z)(t_(i))} refer to N measured signals obtainedat times t_(i), i=0, . . . , N−1. The three unknown quantities are x, y,and z, while the four known quantities are M and the three-axismagnetometer 30 readings. Based on the following discussion, the unknownquantities may be determined.

Turning to FIG. 25, a plot 220 represents simulated data obtained by themagnetometer 30 when the magnetic dipole 28 is rotating arbitrarily,M=100 Amp-m², x=5 m, y=2 m, and z=12 m. An ordinate 222 represents ameasurement of the magnetic field components of {right arrow over (B)}in units of nanoTesla, and an abscissa 224 represents time in units ofseconds. In the plot 220, a triangle represents a data point of ameasurement of the x-component of the magnetic field, {B_(x)(t_(i))}, adiamond represents a data point of a measurement of the y-component ofthe magnetic field, {B_(y)(t_(i))}, and a circle represents a data pointof a measurement of the z-component of the magnetic field,{B_(z)(t_(i))}. The magnetometer 30 is assumed to have simultaneouslysampled each magnetic field component every 0.02 seconds for a totalmeasurement time of two seconds, producing 100 data points for eachmagnetic field component. As apparent in the plot 220 of FIG. 25, thereis a significant slowdown of the BHA 18 rotation from 1.5 Hz to 0.7 Hzin 2 seconds, with non-periodic time dependence.

FIG. 26 illustrates a plot 226 of the measured data of FIG. 25 that hasbeen least squares fit such that {C H_(x)(t_(i))} is fit to{B_(z)(t_(i))}. An ordinate 228 represents a least squares fitting of {CH_(x)(t_(i))} to {B_(z)(t_(i))} in units of nanoTesla, and an abscissa230 represents time in units of seconds. In the plot 226, a trianglerepresents a data point of a measurement of the rotated and scaledx′-component of the magnetic field, {C H_(x)(t_(i))}, and a circlerepresents a data point of a measurement of the z-component of themagnetic field, {B_(z)(t_(i))}. The least squares fitting of FIG. 26 maybe determined by minimizing χ² in Equation (47) to produce {tilde over(θ)}=3.515 radians and C=2.259. As illustrated in FIG. 26, the two datasets {C H_(x)(t_(i))} and {B_(z)(t_(i))} now overlay in the rotatedframe.

FIG. 27 illustrates a plot 232 of the rotated magnetic field data, whichmay be obtained by applying Equation (49) with {tilde over (θ)}=3.515radians. An ordinate 234 represents the magnetic field components in therotated frame in units of nanoTesla, and an abscissa 236 represents timein units of seconds. In the plot 232, a triangle represents a data pointof a measurement of the rotated x′-component of the magnetic field,{H_(x)(t_(i))}, a diamond represents a data point of a measurement ofthe rotated y′-component of the magnetic field, {H_(y)(t_(i))}, and acircle represents a data point of a measurement of the z-component ofthe magnetic field, {B_(z)(t_(i))}. The rotated magnetic fieldcomponent, {H_(x)(t_(i))}, is in-phase with {B_(z)(t_(i))}.

Once the fields in the rotated frame have been obtained, as illustratedin FIG. 27, it may be possible to calculate the location of theobservation point with respect to the arbitrarily rotating magneticdipole 28. In the prior examples, the amplitudes and phases of thesinusoidal functions were used; in this case, the maximum values for themagnetic field components are used. First, maximum amplitudes of themagnetic field components in the rotated frame of reference may bedefined according to the following relationships:

H _(xm)≡max{|H _(x)(t _(i))|}  (50a);

H _(ym)≡max{|H _(y)(t _(i))|}  (50b); and

B _(zm)≡max{|B _(x)(t _(i))|}  (50c).

For good accuracy, there should be a sufficient density of measurementssuch that the true peak values are obtained. The distance {tilde over(r)} may be obtained from the following relationship:

$\begin{matrix}{\overset{\sim}{r} = {\sqrt[3]{\frac{\mu_{0}M}{4\pi {H_{ym}}}}.}} & (51)\end{matrix}$

The {tilde over (z)} coordinate may be obtained from the followingrelationship:

$\begin{matrix}{\overset{\sim}{z} = {{\pm \; \overset{\sim}{r}}\; \sqrt{\frac{2}{3}}{\sqrt{1 \pm {\frac{1}{2}{\frac{H_{xm}}{H_{ym}}}}}.}}} & (52)\end{matrix}$

As in the techniques described above, the correct signs must be chosenfor the result to be reasonable. The x coordinate may be obtained fromthe following equation:

$\begin{matrix}{x = {{\pm \; \frac{{\overset{\sim}{r}}^{2}}{3\overset{\sim}{z}\sqrt{1 + \left( {\tan \; \overset{\sim}{\theta}} \right)^{2}}}}{{\frac{B_{zm}}{H_{ym}}}.}}} & (53)\end{matrix}$

The y coordinate may be obtained from the following relationship:

y=x tan {tilde over (θ)}  (54).

For the data employed by the example illustrated by FIGS. 25-28,H_(xm)=2.30 nanoTesla, H_(ym)=4.54 nanoTesla, and B_(zm)=5.02 nanoTesla.The results for the observation point are x=4.89 m, y=1.92 m, andz=11.90 m, with errors of Δx=−0.11 m, Δy=−0.08 m, and Δz=−0.10 m.

One advantage of the approach discussed above with reference toEquations (50)-(54) is that no assumption is made regarding the timedependence of the magnetic dipole 28; thus, arbitrary rotation may beaccommodated. A disadvantage, however, is that the measurement accuracymay be worse because Equations (51)-(53) rely on a single data point foreach magnetic field component. The statistical accuracy for a singledatum is poorer than that for a large number of points fit to function.In addition, if the sample density is too small, then the true peakvalue of the field may not be obtained.

FIG. 28 illustrates a plot 238 illustrating an alternative manner ofdetermining the peak amplitudes of the rotated magnetic fieldcomponents. The two deficiencies discussed above may be ameliorated byfitting the data to a function of the following form:

F(t)=A+B(T−t)²  (55),

where A, B, and T are fitting parameters, and the extremum A is obtainedat t=T.

The plot 238 of FIG. 28 illustrates the application of Equation (55) tothe data of the plot 232 of FIG. 27. Particularly, an ordinate 240represents the fitting of the magnetic field maxima and minima in unitsof nanoTesla, and an abscissa 242 represents time in units of seconds.In the plot 238, a triangle represents a data point of a measurement ofthe rotated x′-component of the magnetic field, {H_(x)(t_(i))}, adiamond represents a data point of a measurement of the rotatedy′-component of the magnetic field, {H_(y)(t_(i))}, and a circlerepresents a data point of a measurement of the z-component of themagnetic field, {B_(z)(t_(i))}. Fittings of the maxima 244 and minima246 of the data are illustrated with a solid line. Averaging the peakabsolute values for the three magnetic field components yieldsH_(xm)=2.16±0.01 nanoTesla, H_(ym)=4.35±0.01 nanoTesla, andB_(zm)=4.94±0.04 nanoTesla, where the standard deviations of theindividual peaks are also quoted. Using these values in Equations (51)to (54) produces an improvement in the results: x=5.10 m, y=2.00 m, and{tilde over (z)}=12.03 m, with errors of Δx=0.10 m, Δy=0.00 m, andΔz=0.03 m.

Other approaches to obtaining the extrema of H_(xm), H_(ym), and B_(zm)may be followed. For example, the magnetic field {right arrow over (B)}measurement data can be least squares fit to polynomials before or afterrotation by the angle {tilde over (θ)}. Another approach is to perform aFourier transform into the frequency domain, filtering the data in thefrequency domain to reduce noise, and then transforming into the timedomain. Such an approach may result in smoothed functions from which theextrema may be selected.

FIG. 29 illustrates a flowchart 248, which describes a general manner ofdrilling a new well, such as the injector well 12, proximate to anexisting well, such as the producer well 14, when the magnetic dipole 28rotates arbitrarily. The flowchart 248 generally recounts the techniquesdescribed above, as modified for use when the magnetometer 30 in theproducer well 14 takes measurements when the magnetic dipole 28 isrotating at an arbitrary frequency in the injector well 12, rather thanwhen the magnetic dipole 28 is rotating at a constant, increasing, ordecreasing frequency.

In a first step 250, the three magnetic field components of {right arrowover (B)} from the arbitrarily rotating magnetic dipole 28 may bemeasured by the magnetometer 30 for a predetermined period of time(e.g., two seconds or one or more periods of rotation of the magneticdipole 28). Such measurements may be denoted as {B_(x)(t_(i))},{B_(y)(t_(i))}, and {B_(z)(t_(i))} for i=0, 2, 3, . . . , N−1. Themagnetic field components are represented in the (x,y,z) coordinatesystem defined by the magnetic dipole 28, in which the magnetic dipole28 rotates around the z-axis in the plane of the x and y axes. The rawmagnetometer 30 readings may be received by the data acquisitioncircuitry 42 before being stored in the database 44 or transmitted tothe data processing circuitry 46.

In step 252, the raw data collected in step 250 may be scaled and fittedsuch that the rotated magnetic field component, {H_(x)(t_(i))}, isin-phase with {B_(z)(t_(i))}. As such, in step 252, the data processingcircuitry may minimize the quantity with respect to the parameters θ andC,

$\begin{matrix}{\chi^{2} = {\sum\limits_{i}\left\{ {{{CH}_{x}\left( t_{i} \right)} - {B_{z}\left( t_{i} \right)}} \right\}^{2}}} \\{= {\sum\limits_{i}{\left\{ {{C\left\lbrack {{\cos \; \theta \; {B_{x}\left( t_{i} \right)}} + {\sin \; \theta \; {B_{y}\left( t_{i} \right)}}} \right\rbrack} - {B_{z}\left( t_{i} \right)}} \right\}^{2}.}}}\end{matrix}$

A particular example of the least squares fitting of step 252 isdiscussed above with reference to FIG. 26.

The rotated frame of reference may be determined in steps 254 and 256.In step 254, the data processing circuitry 46 may obtain the direction γfrom the z-axis of the magnetic dipole toward the magnetometer fromγ={tilde over (θ)}+n·π, where n=0,1. It should be noted that {tilde over(θ)} may be obtained from step 252. In step 256, the data processingcircuitry may calculate the two transverse magnetic field components inthe rotated frame using the relationship

$\begin{bmatrix}{H_{x}\left( t_{i} \right)} \\{H_{y}\left( t_{i} \right)}\end{bmatrix} = {\begin{bmatrix}{\cos \; \overset{\sim}{\theta}} & {\sin \; \overset{\sim}{\theta}} \\{{- \sin}\; \overset{\sim}{\theta}} & {\cos \; \overset{\sim}{\theta}}\end{bmatrix}\begin{bmatrix}{B_{x}\left( t_{i} \right)} \\{B_{y}\left( t_{i} \right)}\end{bmatrix}}$

and using the angle {tilde over (θ)}.

In steps 258-266, the data processing circuitry 46 may determine therelative location of the magnetometer 30 to the rotating magnetic dipole28. In step 258, the data processing circuitry 46 may calculate themagnetic field maximum amplitudes in any manner. For example, the dataprocessing circuitry 46 may determine the maximum amplitudes from therelationships H_(xm)≡max{|H_(x)(t_(i))|}, H_(ym)≡max{|H_(y)(t_(i))|},and B_(zm)≡max{|B_(z)(t_(i))|}. Alternatively, the data processingcircuitry 46 may fit the region near each extremum of the measured datato a function of the form F(t)=A+B(T−t)² and determine the maximumamplitudes from the set of values for A for each magnetic fieldcomponent in the rotated frame.

Based on the calculation of step 258, in step 260, the data processingcircuitry 46 may next calculate the distance between the magnetic dipoleand the magnetometer with

$\overset{\sim}{r} = {\sqrt[3]{\frac{\mu_{0}M}{4\pi {H_{ym}}}}.}$

In step 262, the data processing circuitry 46 may calculate themagnetometer's z position with

${\overset{\sim}{z} = {{\pm \overset{\sim}{r}}\; \sqrt{\frac{2}{3}}\sqrt{1 \pm {\frac{1}{2}{\frac{H_{xm}}{H_{ym}}}}}}},$

and in step 264, the data processing circuitry 46 may calculate themagnetometer's x position with

$x = {{\pm \frac{{\overset{\sim}{r}}^{2}}{3\overset{\sim}{z}\sqrt{1 + \left( {\tan \; \overset{\sim}{\theta}} \right)^{2}}}}{{\frac{B_{zm}}{H_{ym}}}.}}$

The data processing circuitry 46 may finally calculate themagnetometer's y position with y=x tan {tilde over (θ)} in step 266.

Based on the above steps 258-266, in step 268, the data processingcircuitry 46 may output a relative location report 48 indicating therelative location of the magnetometer 30 to the magnetic dipole 28.Thus, the position of the magnetic dipole 28 in a coordinate systemattached to the magnetometer is (−x,−y,−{tilde over (z)}). Theinformation provided by the report 48 may be employed to steer the BHA18 to drill a desired configuration. For example, the BHA 18 may besteered by the BHA control/MWD interface 50 such that the BHA 18 drillsat an approximately constant distance (e.g., 4-6 m) above an existingwell containing the magnetometer 30, which may create a SAGD well pairas illustrated in the well-drilling operation 10 of FIG. 1.

The foregoing analysis has focused on forcing H_(x)(t) to be in-phasewith B_(z)(t) by choosing the proper rotation angle θ. An alternativeapproach would be to force H_(y)(t) to be π/2 radians out-of-phase withB_(z)(t) by the proper choice of the rotation angle θ. Both methods areequivalent and based on the same fundamental concept. Based on the leastsquares fitting of FIG. 26, the relative location of the magnetometer 30to the magnetic dipole 28. Equation (33) may be used to compute theangle {tilde over (θ)}, which gives the direction from the observationpoint to the z-axis, and where tan {tilde over (θ)}=y/x can be used toeliminate one unknown quantity. The results are thus tan {tilde over(θ)}=0.407 and {tilde over (θ)}=0.386 radians. Next, Equations (35) and(36) may be used to obtain H_(ox)=1.45 nanoTesla, and H_(oy)=2.07nanoTesla, and Equation (38) yields {tilde over (r)}=16.90 m with anerror Δr={tilde over (r)}−r=0.02 m, where the “true” value for r wasobtained from the initial conditions in the calculation. Finally,Equation (39) yields {tilde over (z)}=−16.03 m with an error Δz={tildeover (z)}−z=−0.03 m, Equation (40) yields x=4.99 m with an errorΔx=x−x=−0.01 m, and Equation (41) yields y=2.03 m with an errorΔy=y−y=0.03 m.

As described, the entire process may be done without the requirement ofhuman intervention. It can be operated as a closed loop feedback systemwith human oversight. Various steps in the process, such as computingthe corrections and generating the steering correction can of course bedone by wellsite personnel in accordance with an exemplary embodiment.However, automated computing may be more efficient. It should be notedthat the automated method described above in accordance with anexemplary embodiment may be applied to any pair of wells, and is notlimited to SAGD applications. The two wells may be non-parallel ingeneral, and may even be perpendicular. Furthermore, an exemplaryembodiment may be used with the magnetometer 30 deployed on a wirelineor coiled tubing string, in addition to being mounted in the BHA 18.

Present embodiments may be more efficient than conventional techniquesfor magnetic ranging. For example, present embodiments may facilitateefficient determination of the relative location of a magnetometer to aborehole assembly (BHA). Indeed, a rotating magnetic dipole in a BHA maybe measured over time from a single remote location. Based on themeasurement data from the single remote location, data processingcircuitry may determine the remote location. Thus, by refraining frommultiple measurement locations, the above-disclosed techniques mayconserve rig time. Present embodiments may also facilitate automation ofall or a substantial portion of the entire process for determining theposition of a BHA from an adjacent well and steering it based on therelative distance to the remote location.

While only certain features of the invention have been illustrated anddescribed herein, many modifications and changes will occur to thoseskilled in the art. It is, therefore, to be understood that the appendedclaims are intended to cover all such modifications and changes as fallwithin the true spirit of the invention.

1. (canceled)
 2. (canceled)
 3. (canceled)
 4. (canceled)
 5. (canceled) 6.(canceled)
 7. (canceled)
 8. (canceled)
 9. (canceled)
 10. (canceled) 11.(canceled)
 12. (canceled)
 13. (canceled)
 14. (canceled)
 15. (canceled)16. (canceled)
 17. (canceled)
 18. (canceled)
 19. (canceled) 20.(canceled)
 21. (canceled)
 22. (canceled)
 23. (canceled)
 24. (canceled)25. (canceled)
 26. (canceled)
 27. (canceled)
 28. (canceled) 29.(canceled)
 30. (canceled)
 31. A system comprising: a three-axismagnetometer configured to determine a set of measurements over a periodof time of a time-dependent magnetic field caused by a magnetic sourcerotating about an axis, wherein the set of measurements includes oneaxial component aligned with the axis and two transverse componentstransverse to the axis, wherein the two transverse components areperpendicular to one another; and data processing circuitry configuredto determine a transverse angle of rotation of the set of measurements,such that one of the two transverse components is in phase with the oneaxial component when the transverse angle of rotation is used totransform the set of measurements, and to determine a spatialrelationship between the magnetic source and the three-axis magnetometerbased at least in part on the transverse angle of rotation.
 32. Thesystem of claim 31, wherein the data processing circuitry is configuredto determine sinusoidal functions that fit to the one axial componentand the two transverse components.
 33. The system of claim 31, whereinthe data processing circuitry is configured to determine amplitudes ofthe one axial component and of the two transverse components in thereference frame rotated transversely by the rotation angle and whereinthe data processing circuitry is configured to determine the spatialrelationship based at least in part on the determined amplitudes. 34.The system of claim 31, comprising a borehole assembly having themagnetic dipole source, wherein the axis is aligned with an axis of theborehole assembly.
 35. The system of claim 34, wherein the magneticsource is a permanent magnet, a solenoid, or any combination thereof.36. The system of claim 34, comprising control circuitry configured toprovide a drilling trajectory to the borehole assembly based at least inpart on the spatial relationship between the magnetic dipole source andthe three-axis magnetometer.
 37. The system of claim 36, wherein thedrilling trajectory is configured to cause the borehole assembly todrill the well at an approximately constant distance from themagnetometer.
 38. A system comprising: a memory device having aplurality of routines stored therein; a processor configured to executethe plurality of routines stored in the memory device, the plurality ofroutines comprising: a routine configured to effect, when executed,receiving of a three-component measurement by a three-axis magnetometerof a time-dependent magnetic field caused by a magnetic source rotatingabout an axis, wherein the three-component measurement includes an axialcomponent aligned with the axis and two transverse components transverseto the axis, and wherein the two transverse components are perpendicularto one another; a routine configured to effect, when executed,transformation of the three-component measurement by a transverse angleof rotation such that one of the two transverse components is π/2radians out of phase with the axial component; a routine configured toeffect, when executed, determination of a relative location between themagnetometer and the magnetic source based at least in part on thetransverse angle of rotation; and a routine configured to effect, whenexecuted, outputting of a report indicating the relative location. 39.The system of claim 38, wherein the plurality of routines comprises aroutine configured to effect, when executed, fitting of thethree-component measurement to sinusoidal curves.
 40. The system ofclaim 38, wherein two transverse components include a vertical componentand a horizontal component and wherein the one of the two transversecomponents transformed to be π/2 radians out of phase with the axialcomponent is the horizontal component.
 41. The system of claim 38,wherein the plurality of routines comprises a routine configured toeffect, when executed, determination of amplitudes of the transformedthree-component measurement.
 42. The system of claim 41, wherein theroutine configured to effect determination of the relative location isconfigured to effect determination of the relative location based atleast in part on the determined amplitudes of the transformedthree-component measurement.
 43. The system of claim 42, wherein theroutine configured to effect determination of the relative location isconfigured to effect determination of the relative location based atleast in part on a determination of a distance between the magnetometerand the magnetic source, wherein the distance between the magnetometerand the magnetic source is determined based at least in part on one ofthe determined amplitudes of the transformed three-componentmeasurement.
 44. A method comprising: generating a time-dependentmagnetic field using a magnetic source rotating about an axis, whereinthe magnetic source is located in a first well; measuring thetime-dependent magnetic field using a three-axis magnetometer located ina second well, wherein the measurements are capable of indicating oneaxial component aligned with the axis and two transverse componentstransverse to the axis, wherein the two transverse components areperpendicular to one another; determining a transverse angle of rotationthat, when used in a transformation of the measurements of thetime-dependent magnetic field, causes extrema of one of the transversecomponents to occur when extrema of the axial component occur; anddetermining a relative location between the magnetic source and themagnetometer based at least in part on the transverse angle of rotation.45. The method of claim 44, wherein the transverse angle of rotation isdetermined such that, when used in the transformation of themeasurements of the time-dependent magnetic field, the one of thetransverse components aligns with the axial component when the one ofthe transverse components is multiplied by a scalar quantity.
 46. Themethod of claim 44, wherein the relative location is determined based atleast in part on a determination of maximum amplitudes of one axialcomponent and two transverse components of the transformed measurementsof the time-dependent magnetic field.
 47. The method of claim 46,wherein the maximum amplitudes are determined based on curves fit tomaxima of the one axial component and the two transverse components ofthe transformed measurements of the time-dependent magnetic field.
 48. Amethod comprising: drilling a new well using a borehole assembly havinga magnetic source source, wherein the magnetic source is configured torotate about the axis of the borehole assembly, wherein the magneticsource is configured to generate a time-dependent magnetic field;measuring a time-dependent magnetic field using a three-axismagnetometer located in an existing well, wherein the measurement of thetime-dependent magnetic field includes one axial component aligned withthe axis of the borehole assembly and two transverse componentstransverse to the axis of the borehole assembly, wherein the twotransverse components are perpendicular to one another; determining arelative location of the magnetometer to the magnetic dipole sourcebased at least in part on a transverse angle of rotation that, when usedin a transformation of the measurements of the time-dependent magneticfield, causes extrema of one of the transverse components to occur whenextrema of the axial component occur; and communicating a drillingtrajectory to the borehole assembly based at least in part on therelative location of the magnetometer to the magnetic source.
 49. Themethod of claim 48, wherein measuring the time-dependent magnetic fieldcomprises measuring the time-dependent magnetic field from a singlelocation of the magnetometer.
 50. The method of claim 48, whereindetermining the relative location of the magnetometer to the magneticsource comprises determining maximum amplitudes of the one axialcomponent and two transverse components of the transformed measurementsof the time-dependent magnetic field.